item Method
Last Updated: 08-22-2005
Retrieves an object from the collection by its index.

var oNode = object.item(iIndex);

iIndex Required. The 0-based index of the desired object in the collection.

Return Value
The object in the collection specified by its index.


To illustrate usage of the item method, suppose you have an XML document structured like the following:

<?xml version="1.0"?>
<?access-control allow="*"?>

Here is a program that obtains a NodeList containing the children of the document element node and then uses the item method to obtain the first child node from that list.

<vxml version="2.1">
   <data name="dom" src="test.exml"/>
   <form id="main">
         var nodes = dom.documentElement.childNodes; // returns a NodeList
         var n = nodes.item(0); // returns a node, the nodeName of which is 'a' 
         vxmllog("nodeName of first document element child is " +

Applies To
Attributes, NodeList
[24]7 Inc.| Terms of Service| Privacy Policy| General Disclaimers