Created
July 9, 2013 15:24
-
-
Save DanTup/5958265 to your computer and use it in GitHub Desktop.
Strange IE10 issue. In IE7/8/9 this code will throw an error (attributes["onchange"] returns null). But in IE10, magic happens, and attributes["onchange"] returns attributes["name"] and the code alerts the name of the element!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/> | |
</head> | |
<frameset rows="70,*"> | |
<frame src="about:blank"> | |
<frameset cols="165,*"> | |
<frame src="about:blank"> | |
<frame src="settings.htm"> | |
</frameset> | |
</frameset> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE> | |
<html> | |
<body> | |
<select name="danny_name" id="danny_id"> | |
<option selected="selected" value="option1">Option 1</option> | |
</select> | |
<script type="text/javascript"> | |
alert(document.getElementById('danny_id').attributes["onchange"].nodeValue); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment