Easy Tutorial
❮ Met Document Getelementsbytagnamens Dom Prop Document Documentelement ❯

XML DOM nodeType Property



Definition and Usage

The nodeType property returns the node type of the node.

Syntax


In all examples, we use the XML file books.xml and the JavaScript function loadXMLDoc().

Example

The following code snippet displays the node name and node type of the root node:

Example

Output:


❮ Met Document Getelementsbytagnamens Dom Prop Document Documentelement ❯