Change Language


Follow Navioo On Twitter

NodeList : Array

Collection of nodes accessible by index.

Platform Support

IE Mozilla Netscape Opera Safari
no 1.0+ 7.0+ no no

Constructors

Constructor Action IE Mozilla Netscape Opera Safari
NodeList Constructor() : NodeList
Collection of nodes accessible by index.
Show Details no 1.0+ 7.0+ no no

NodeList() : NodeList

Collection of nodes accessible by index.

Returns

NodeList
Visibility
internal

Properties

Property Action IE Mozilla Netscape Opera Safari
length : Number
The number of nodes in this list.
Show Details no 1.0+ 7.0+ no no
Remarks
Number of nodes contained within this NodeList. If no nodes are in this list, returns 0.
Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

Functions

Method Action IE Mozilla Netscape Opera Safari
static item(Number index) : Node
Returns the node contained at the specified index.
Show Details no 1.0+ 7.0+ no no

Parameters

Number index Index number to retrieve.

Returns

Node

Using item

for (var idx = 0; idx 
                        
                        					

For more examples, see the Navioo examples page:

http://www.navioo.com/javascript/dhtml/Node_Operation_978.dhtml

Remarks
Returns the node contained within this NodeList at the given index number. The index values start counting at 0, and a null value will be returned if an invalid index is supplied.
Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

Remarks

A NodeList is a sort of array which is used to contain a collection of nodes. It is commonly used throughout the DOM objects as a way of returning a list of nodes, whether as a listing of Node.attributes bound to an Element, or as a list of Node.childNodes.

Though in principle this object is similar to an Array, it is merely a very rudimentary form, and as such there is no relationship between the two objects. The list of methods and properties a NodeList supports is quite small in comparison.

References

NamedNodeMap

Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

text_javascript Navioo_docs

Ajax Javascript feed

↑ Grab this Headline Animator