XML DOM nodeType property
Definition and Usage
nodeType property returns the node type node.
grammar
documentObject.nodeType
In all instances, we use XML files books.xml and the JavaScript function loadXMLDoc () .
Examples
The following code fragment displays the node name and node type of the root node:
Examples
xmlDoc=loadXMLDoc("books.xml");
document.write("Nodename: " + xmlDoc.nodeName);
document.write(" (nodetype: " + xmlDoc.nodeType);
document.write("Nodename: " + xmlDoc.nodeName);
document.write(" (nodetype: " + xmlDoc.nodeType);
Output:
Nodename: #document (nodetype: 9)
try it"
Document Object