HTML DOM name Property
Example
Returns the attribute name:
document.getElementsByTagName("button")[0].attributes[0].name;
Output result:
onclick
Try it »
Definition and Usage
The name property returns the attribute name.
Browser support





All major browsers support the name property.
Syntax
attribute
.name
Technical Details
| Return Value: | A string representing the attribute name. |
|---|---|
| DOM version | Core Level 1 |
Attribute object