The DOM removeAttribute() method is used to remove an attribute with specified name from the element. It is similar to removeAttributeNode() method but the difference is that the removeAttributeNode method is used to remove the specified attribute object, but on the other hand removeAttribute removes the attribute with the specified name.
Where name is the string which specifies the name of the attribute to remove from the element. It is the required field.
Before click on the button:
After click on the button:
Supported Browsers: The browser supported by removeAttribute() method are listed below:
- Google Chrome
- Internet Explorer