Browser/User Agent Support
| IE | Mozilla | Netscape | Opera | Safari | Netscapte | no | 1.0+ | 7.0+ | no | no | no |
|---|
Constructors
| Constructor | IE | Mozilla | Netscape | Opera | Safari | Netscapte |
|---|---|---|---|---|---|---|
Collection of nodes accessible by index. | no | 1.0+ | 7.0+ | no | no | no |
Properties
| Property | IE | Mozilla | Netscape | Opera | Safari | Netscapte |
|---|---|---|---|---|---|---|
The number of nodes in this list. | no | 1.0+ | 7.0+ | no | no | no |
Methods
| Method | IE | Mozilla | Netscape | Opera | Safari | Netscapte |
|---|---|---|---|---|---|---|
Returns the node contained at the specified index. | no | 1.0+ | 7.0+ | no | no | no |
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 Element, or as a list of
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
Availability
HTML DOM Level 1 | HTML DOM Level 2 | W3C
Constructor Detail
Property Detail
Number length - read only
The number of nodes in this list.
- 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
Method Detail
item(Number index) : static Node
Returns the node contained at the specified index.
| Number | index | Index number to retrieve. |
-
Using item
for (var idx = 0; idx < node.Node.childNodes.length; idx++) { var curNode = node.Node.childNodes.item(idx); }For more examples, see the quirksmode test page:
- Remarks
- Returns the node contained within this NodeList at the given index number. The index values start counting at 0, and a
nullvalue will be returned if an invalid index is supplied. - Availability
HTML DOM Level 1 | HTML DOM Level 2 | W3C
