HTML DOM removeAttribute() method
Example
Remove the style attribute of the head element:
document.getElementsByTagName("H1")[0].removeAttribute("style");
Before removing the attribute:
Hello World
After removing the attribute:
Hello World
Try it »
Definition and Usage
The removeAttribute() method removes the specified attribute
See similar methods removeAttributeNode() .
Browser support





All major browsers support the removeAttribute() method
Syntax
element
.removeAttribute(
attributename
)
Parameters
| Parameters | Type | Description |
|---|---|---|
| attributename | String | Required. Specifies the name of the attribute to be removed. |
Return Value
No value is returned.
Technical Details
| DOM version | Core Level 1 Element Object |
|---|
Element object