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

XML DOM tagName Property

XML DOM tagName Property


Element Object Reference Element Object


Definition and Usage

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

Syntax

elementNode.tagName


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.tagName);

The code above will output:

title

Try it »


Element Object Reference Element Object