XML DOM length Property
Text Object
Definition and Usage
The length property returns the text length of a node (in characters).
Syntax
textNode.length
Example
The following code snippet uses loadXMLDoc() to load "books.xml" Load into xmlDoc, and output the comment text of the first
Example
xmlDoc=loadXMLDoc("books.xml");
x=xmlDoc.getElementsByTagName("title")[0].childNodes[0];
document.write(x.data);
document.write(" - Length: ");
document.write(x.length);
The code above will output:
Everyday Italian - Length: 16
Try it »
Text Object