Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

XML DOM nodeName Property

XML DOM nodeName Property


Element Object Reference Element Object


Definition and Usage

The nodeName property returns the tag name of the selected element.

Syntax

elementNode.nodeName


Example

The following code snippet uses loadXMLDoc() to load "books.xml" Load into xmlDoc, and from the first element get the tag name: </p>

Example

xmlDoc=loadXMLDoc("books.xml");

x=xmlDoc.getElementsByTagName("title")[0];

document.write(x.nodeName);

The code above will output:

title

Try it »


Element Object Reference Element Object