X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

HTML DOM tagName Property

Element Object Reference Element Object

Example

Get the tagName of an element:

document.getElementById("demo").tagName;

The result will be:

P

Try it yourself »


Definition and Usage

The tagName property returns the tag name of the element.

In HTML the returned value of the tagName property is always in UPPERCASE.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The tagName property is supported in all major browsers.


Syntax

element.tagName

Technical Details

Return Value: A String, representing the tag name of the element
DOM Version Core Level 1 Element Object


Element Object Reference Element Object


Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates FREE Website Templates Free HTML Templates

SHARE THIS PAGE

facebook