Return the name of the first attribute of a button element:
The result could be:
The item() method returns the node at the specified index in a namedNodeMap, as a Node object.
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 in the namedNodeMap you want to return |
| Type | Description |
|---|---|
| Node object | The node at the specified index |
| DOM Version | Core Level 1 |
|---|
Your message has been sent to W3Schools.