Easy Tutorial
❮ Dom Prop Document Inputencoding Prop Element Nodename ❯

XML DOM nodeName Property



Definition and Usage

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

Syntax


Example

The following code snippet uses loadXMLDoc() to load "books.xml" into xmlDoc and displays the node name and node type of the root node:

Example

Output:


Try It

Display the node name and node value of all elements


❮ Dom Prop Document Inputencoding Prop Element Nodename ❯