XML DOM nodeNameProperty


Document object

Definition and Usage

The nodeName property returns the name of a node, based on its type.

Syntax

documentObject.nodeName


Example

The following code snippet usesloadXMLDoc()put "Load "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);

Output:

Nodename: #document (nodetype: 9)

Try it Yourself »

Try it Yourself


Document objectother extensions