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

HTML DOM localName Property

Element Object Reference Element Object

Example

Get the local name of the body element:

document.body.localname;

The result will be:

body

Try it yourself »


Definition and Usage

The localName property returns the local name of the specified node.

The localName property returns the name of element nodes and attribute nodes, for other node types the return value is null.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The localName property is supported in all major browsers.

Note: Internet Explorer 8 and earlier does not support this property.


Syntax

node.localName

Technical Details

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

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

SHARE THIS PAGE

facebook