Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

NodeList

Summary

Represents a list of DOM Nodes

Properties

length
The number of nodes in the list.

Methods

item
Gets the nth item in the collection

Events

No events.

Examples

var list = document.getElementsByClassName('highlighted');
for(var i=0; i<list.length; i++){
    var item = list[i];
}

Notes

The NodeList represents the content as it is currently in the document, and will change as the document changes.

Related specifications

DOM Level 1
W3C Recommendation
DOM
W3C Working Draft