item Method

Internet Development Index

Retrieves an object from the childNodes or children collection.

Syntax

oItem = object.item(vIndex)

Parameters

vIndex Required. Integer that specifies the zero-based index of the item to retrieve.

Return Value

Returns an object, or a collection of objects, if successful, otherwise null.

Example

This example uses the item method to retrieve a collection of the children of the document body.

<SCRIPT LANGUAGE="JScript">
var oItem = document.body.children;
if (oItem!=null) {
for (i=0; i<oItem.length; i++)
alert(oItem.item(i).tagName);
}
</SCRIPT>

Standards Information

There is no public standard that applies to this method.

Applies To

childNodes, children