DOM - NodeList Object



The NodeList object specifies the abstraction of an ordered collection of nodes. The items in the NodeList are accessible via an integral index, starting from 0.

Attributes

The following table lists the attributes of the NodeList object −

Attribute Type Description
length unsigned long It gives the number of nodes in the node list.

Methods

The following is the only method of the NodeList object.

S.No. Method & Description
1 item()

It returns the indexth item in the collection. If index is greater than or equal to the number of nodes in the list, this returns null.

Advertisements