Created
April 7, 2011 11:20
-
-
Save ryuone/907594 to your computer and use it in GitHub Desktop.
IE9RCのdocument.getElementsByNameの挙動がおかしい。
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 charset='UTF-8' /> | |
<title>getElementsByName</title> | |
</head> | |
<body> | |
<!-- IE9RC : すべてlengthは1が返ってくる。 --> | |
<!-- Firefox : すべてlengthは0が返ってくる。 --> | |
<a id='aname' onclick="alert(document.getElementsByName('aname').length)">clickme(a)!!</a> | |
<div id='divname' onclick="alert(document.getElementsByName('divname').length)">clickme(div)!!</div> | |
<article id='articlename' onclick="alert(document.getElementsByName('articlename').length)">clickme(article)!!</article> | |
<canvas id='canvasname' onclick="alert(document.getElementsByName('canvasname').length)" style='border:1px solid #000;'>clickme(canvas)!!</canvas> | |
</body> | |
</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> | |
<html> | |
<head> | |
<meta charset='UTF-8' /> | |
<title>getElementsByName</title> | |
</head> | |
<body> | |
<!-- IE9RC : a要素のみ1であとは0が返ってくる。 --> | |
<!-- Firefox : すべてlengthは1が返ってくる。 --> | |
<a name='aname' onclick="alert(document.getElementsByName('aname').length)">clickme(a)!!</a> | |
<div name='divname' onclick="alert(document.getElementsByName('divname').length)">clickme(div)!!</div> | |
<article name='articlename' onclick="alert(document.getElementsByName('articlename').length)">clickme(article)!!</article> | |
<canvas name='canvasname' onclick="alert(document.getElementsByName('canvasname').length)" style='border:1px solid #000;'>clickme(canvas)!!</canvas> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment