Javascript Reference - HTML DOM item() Method








The item() method returns the node at the specified index in a namedNodeMap, as a Node object.

This syntax:

attributes.item(0);

has the same result as this syntax:

attributes[0];

Browser Support

item Yes Yes Yes Yes Yes

Syntax

nodeObj.item(index);

Parameters

Parameter Type Description
index Number Required. The index of the node in the namedNodeMap to return




Return Value

Type Description
Node object The node at the specified index