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
Post a Comment