Chapter 3 DynaScript Predefined Objects
Represents an ordered collection of nodes.
To use a DOMNodeList's property:
DOMNodeList.propertyName
To use a DOMNodeList's method:
DOMNodeList.MethodName( parameter )
The DOMNodeList
object
represents an ordered collection of DOMNode
objects,
or any object that inherits from DOMNode
.
The objects on the node list are accessible via an integral index.
Index values start at zero.
DOMNodeList.length
The number of objects in the list.
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 }
DOMNodeList.item( index )
Returns the indexth item in the collection. Valid values for index are 0 through length minus 1.
The node at the indexth position or null if the index is invalid
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 © 2001 Sybase, Inc. All rights reserved. |
![]() |