XML DOM data Property
Text Object
Definition and Usage
The data property sets or returns the text of an element or an attribute.
Syntax
textNode.data
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);
The code above will output:
Everyday Italian
Try it »
Text Object