Chapter 3 DynaScript Predefined Objects


DOMCharacterData properties

The DOMCharacterData object has the properties listed in this section, in addition to all of the properties of the DOMNode object, which are inherited:

data property

Syntax

DOMCharacterData.data

Description

The text represented by this object.

Example

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 )

length property

Syntax

DOMCharacterData.length

Description

The number of characters in the text representing by this object. The length is an integer value greater than or equal to zero.

Example

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.