Easy Tutorial
❮ Prop Document Nodetype Prop Attr Baseuri ❯

XML DOM documentElement Property



Definition and Usage

The documentElement property returns the root node of the document.

Syntax


Example

The following code snippet uses loadXMLDoc() to load "books.xml" into xmlDoc and displays the location of the XML document:

Example

xmlDoc=loadXMLDoc("books.xml");

x=xmlDoc.documentElement;

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

Output:


❮ Prop Document Nodetype Prop Attr Baseuri ❯