internet explorer - Simple javascript function not working in IE7 -


code works across major browsers, firing simple alert on click not working.

this in header

<script type="text/javascript">     function this_function() {         alert("got here mango!");     } </script> 

this in body

<button type="button" onclick="this_function()">click me</button> 

if put "onclick" tag works fine , dandy.

any , suggestions on how work in ie great. in advance.

sorry, "into tag" meant putting onclick="alert()" tag.

try: <button type="button" onclick="javascript:this_function();">click me</button>

it's advised separate javascript , markup. regardless should assign id button , attach onclick handler this:

document.getelementbyid("button").onclick = function() {      alert("got here mango!"); }; ​ 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -