XML DOM nodeTypeProperty
Node object
Definition and Usage
The nodeType property returns the node type of a node.
Syntax
nodeObject.nodeType
Example
The following code snippet usesloadXMLDoc()put "books.xml" Load it into xmlDoc and display the node name and node type of the root node:
Example
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 Yourself »
Node objectother extensions