Latest web development tutorials

XML DOM documentElement property

Document Object Reference Document Object

Definition and Usage

documentElement property returns the root node of the document.

grammar

documentObject.documentElement


Examples

The following code fragment uses loadXMLDoc () to " the Books.xml " into xmlDoc, showing the location of the XML document:

Examples

xmlDoc=loadXMLDoc("books.xml");

x=xmlDoc.documentElement;

document.write("Nodename: " + x.nodeName + "
");
document.write("Nodevalue: " + x.nodeValue + "
");
document.write("Nodetype: " + x.nodeType);

Output:

Nodename: bookstore
Nodevalue: null
Nodetype: 1

try it"

Document Object Reference Document Object