Chrome getElementsByTagName returning HTMLCollection vs NodeList Chrome getElementsByTagName returning HTMLCollection vs NodeList google-chrome google-chrome

Chrome getElementsByTagName returning HTMLCollection vs NodeList


From the developer firefox documentation:

While the W3C DOM 3 Core specification says elements is a NodeList that was simply because of a an attempt to have the "core" specification not depend on the "html" specification at that time. The DOM 4 draft says that elements is an HTMLCollection.

Gecko/Firefox currently returns a NodeList (Bug 162927) but starting with Gecko/Firefox 19, this method will return HTMLCollection (Bug 799464). Internet Explorer returns a HTMLCollection. WebKit returns a NodeList. Opera also returns a NodeList, but with a namedItem method implemented, which makes it similar to a HTMLCollection.