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

HTML DOM nodeName Property

Element Object Reference Element Object

Example

Get the node name of the body element:

document.body.nodeName;

The result will be:

BODY

Try it yourself »


Definition and Usage

The nodeName property returns the name of the specified node.

If the node is an element node, the nodeName property will return the tagname.

If the node is an attribute node, the nodeName property will return the name of the attribute.

For other node types, the nodeName property will return different names for different node types.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The nodeName property is supported in all major browsers.


Syntax

node.nodeName

Technical Details

Return Value: A String, representing the name of the node
DOM Version Core Level 1 Node 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

SHARE THIS PAGE

facebook