HTML DOM removeAttribute()Method
Examples
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 Yourself »
Definition and Usage
The removeAttribute() method removes the specified attribute.
View similar methods removeAttributeNode() 。
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the removeAttribute() method.
Syntax
element.removeAttribute(attributename)
Parameters
| Parameter | Type | Description |
|---|---|---|
| attributename | String | Required. Specifies the name of the attribute to remove. |
Return Value
No return value.
Technical Details
| DOM Version | Core Level 1 Element Object |
|---|
Other Extensions
Element Object