Javascript Reference
Categories: Element

javascript Element tagName

@March 15, 2008, 1:22 a.m.
tagNameFirefox/Netscape/NN 6 IE 4 Chrome/Safari/DOM 1  

Read-only  

Returns the name of the tag of the current element. Tag names are always returned in all uppercase letters for purposes of string comparisons, regardless of source code style or DOCTYPE declaration.

 
Example
 
var theTag = document.getElementById("elementID").tagName;
 
Value

String.

 
Default

Element-specific.


Powered by Linode.