You should node that in MSIE, the Collection object has an Item() method whereas DOM mandates that a NodeList should have an item() method. Note the difference in the case of the initial letter.
Even though an implementation may forgive an upper-lower case error when it parses the script source text, an item() call on NodeList can only return a Node object referenced using an integer index location within the collection.
Because the NodeList is based on an Array, NodeList.item(anIndex) is functionally equivalent to NodeList[anIndex] and one can enumerate through the set of Node objects using either technique.
Prev | Home | Next |
NodeList object | Up | NodeList.length |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |