Search w3schools.com:

SHARE THIS PAGE

XML DOM text Property


Document Object Reference Document Object

Definition and Usage

The text property returns the text of a node and its descendants.

Syntax

documentObject.text


Tips and Notes

Note: This property is Internet Explorer-only!


Example

The following code fragment loads "books.xml" into xmlDoc using loadXMLDoc() and displays the text of the XML document:

Example

xmlDoc=loadXMLDoc("books.xml");
document.write(xmlDoc.text);

Output:

Everyday Italian Giada De Laurentiis 2005 30.00
Harry Potter J K. Rowling 2005 29.99 XQuery Kick Start
James McGovern Per Bothner Kurt Cagle James Linn
Vaidyanathan Nagarajan 2003 49.99 Learning XML
Erik T. Ray 2003 39.95

Try it yourself »

Document Object Reference Document Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]