NodeList object (Object/DOM)

A generic collection of nodes, not presented in any particular order.

Availability:

DOM level - 1
JavaScript - 1.5
JScript - 5.0
Internet Explorer - 5.0
Netscape - 6.0
JavaScript syntax:-myNodeList = myDocument.getElementsByTagName(aTagName)
Argument list:aTagNameThe name of an HTML tag
Object properties:length
Object methods:item()

This object is based on an Array object and contains a set of Node items contained within a DOM hierarchy.

Do not confuse DOM NodeList arrays with Enumerator or Collection objects. The NodeListitem() method is subtly different to the Enumerator.Item() method.

See also:Collection object, Document.getElementsByTagName(), Element.getElementsByTagName(), Enumerator object, NamedNodeMap object, Node.childNodes[]

PropertyJavaScriptJScriptNIEOperaNESECMADOMCSSHTMLNotes
length1.5 1.55.0 5.06.0 6.05.0 5.03.0 3.0 n/a n/a1 1 n/a n/aReadOnly.

MethodJavaScriptJScriptNIEOperaNESECMADOMCSSHTMLNotes
item()1.5 1.55.0 5.06.0 6.05.0 5.0 n/a n/a n/a1 1 n/a n/a-