Chapter 3 DynaScript Predefined Objects


DOMNodeList methods

The DOMNodeList object has these methods:

item method

Syntax

DOMNodeList.item( index )

Description

Returns the indexth item in the collection. Valid values for index are 0 through length - 1.

Return

The node at the indexth position or null if the index is invalid.

Example

This fragment loops through the items of a DOMNodeList of elements.

for( iElem=0; 
iElem < domParent.childNodes.length;
iElem++ ) {
thisChild = domParent.childNodes.item( iElem );
// other operations here
}

 


Copyright © 1999 Sybase, Inc. All rights reserved.