Returns the tag name of the current element.
This property retrieves the tag names in uppercase in HTML and in original case in XML documents. The nodeName property can also be used for getting tag names.
You can find the related objects in the Supported by objects section below.
This property is read-only.
String that represents the tag name of the element.
Default: this property has no default value.
Example HTML code 1:
This example illustrates the use of the tagName property:
Did you find this example helpful?
User Contributed Comments