JavaScript Programmer’s Reference NamedNodeMap.item() (Method) The usual collection (Personal web server)

JavaScript Programmer’s Reference NamedNodeMap.item() (Method) The usual collection access by item number also applies to named node maps. A reference to an element in a collection This accesses nodes by their position in the linear sequence of nodes within the map. The index value is zero-based so if the value specified is equal to or greater than the number of nodes in the map, a null value will be returned instead. Warnings: . Note that the item() method for a NamedNodeMap is spelled with a lower case i. The MSIE Collection class also has an Item() method that provides similar (but not identical) ways of accessing items in a collection. Note that Collection.Item() is spelled with a capital I. Availability: DOM level 1 JavaScript 1.5 JScript 5.0 Internet Explorer 5.0 Netscape 6.0 Property/method value type: Node object JavaScript syntax: -myNamedNodeMap.item(anIndex) Argument list: anIndex See also: Collection.Item() NamedNodeMap.length (Property) The number of members in the named node map is returned by this property. Availability: DOM level 1 JavaScript 1.5 JScript 5.0 Internet Explorer 5.0 Netscape 6.0 Property/method value type: Number primitive JavaScript syntax: -myNamedNodeMap.length This is zero-based length of the NamedNodeMap collection/array. It allows you to enumerate through the collection with a for(…)loop, visiting each node in turn. 1480

Leave a Reply