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

HTML DOM name Property

Attributes Object Reference Attribute Object

Example

Return the name of an attribute:

document.getElementsByTagName("button")[0].attributes[0].name;

The result will be:

onclick

Try it yourself »

Definition and Usage

The name property returns the name of the attribute.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The name property is supported in all major browsers.


Syntax

attribute.name

Technical Details

Return Value: A String, representing the name of the attribute
DOM Version Core Level 1


Attributes Object Reference Attribute 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

SHARE THIS PAGE