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.


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.


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.

Kickstart Your Career

Get certified by completing the course

Get Started