Return the first child node of an element:
The item() method returns the node at the specified index in a node lists.
Read more about the Node object in our Node object reference.
This syntax:
Will produce the same result as this syntax:
![]()
The item() method is supported in all major browsers.
| Parameter | Type | Description |
|---|---|---|
| index | Number | Required. The index of the node you want to return, in the node list |
| Type | Description |
|---|---|
| Node object | The node at the specified index |
| DOM Version | Core Level 1 |
|---|
Your message has been sent to W3Schools.