Dom Prop Element Tagname
# 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](#)" into xmlDoc, and retrieves the tag name from the first element:
## Example
xmlDoc=loadXMLDoc("books.xml");
x=xmlDoc.getElementsByTagName("title");
document.write(x.tagName);
The code above will output:
title
[Try it Β»](#)
* * Element Object](#)
YouTip