ie in JS getElementsByTagName cannot get element bugs
Definitions and usage
The getElementsByTagName () method returns a collection of objects with the specified label name.
Grammar
document.getElementsByTagName (tagname) description
The order in which the getElementsByTagName () method returns elements is the order in which they are in the document.
If you pass the special string "*" to the getElementsByTagName () method, it returns a list of all the elements in the document, and the order in which they are arranged is the order in which they are in the document.
Tips and comments
Note: Strings passed to the getElementsByTagName () method can be case-insensitive.
For more details please see: http://www.111cn.net/wy/js-ajax/getelementsbytagname.htm
Click Input[id=test]
IE6/7: Throwing anomalies
IE8/9: Pop-up undefined
Firefox/safari/chrome/opera: Eject [object Htmlinputelement]
When the statement 1 and statement 2 positions are exchanged, they are not reproduced.
When the div.getelementsbytagname is replaced by div.childnodes[0] or div.children[0], it does not reappear.
Preliminary judgment is the implementation of getElementsByTagName in IE, found in the MSDN section:
<!doctype html>
<meta charset= "Utf-8"
getElementsByTagName cannot get element bug</title> in <title>ie;
<body>
<input type= "button" id= "Test" value= "test"
<script>
var html= ' <input type= ' CheckBox ">";
var div = document.createelement ("div");
div.innerhtml = html;
var a = div.getelementsbytagname ("input");//Statement 1
document.body.appendchild (div);//Statement 2
document.getelementbyid ("test"). onclick = function () {
alert (a[0));
} ;
</script>
</body>