Chapter 3 DynaScript Predefined Objects
The DOMCharacterData
object
has the properties listed in this section, in addition to all of
the properties of the DOMNode
object,
which are inherited:
DOMCharacterData.data
The text represented by this object.
This DynaScript fragment writes out the character data associated with all text node children of an element.
child = elem.firstChild;
do {
if( child.nodeType == 3 ){// text node
document.writeln( child.data );
child = child.nextSibling;
}
} while ( child != null )
DOMCharacterData.length
The number of characters in the text representing by this object. The length is an integer value greater than or equal to zero.
This DynaScript fragment writes out the length
of each text node child of a DOMElement
object
named elem.
child = elem.firstChild;
do {
if( child.nodeType == 3 ){// text node
document.writeln( child.data );
child = child.nextSibling;
}
} while ( child != null )
Copyright © 1999 Sybase, Inc. All rights reserved. |