XML DOM tagName Property
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
Example
xmlDoc=loadXMLDoc("books.xml");
x=xmlDoc.getElementsByTagName("title")[0];
document.write(x.tagName);
The code above will output:
title
Try it »
Element Object