HTML DOM removeAttributeNode() method
Example
Remove the attribute node of the head element:
var n=document.getElementsByTagName("INPUT")[0];
var a=n.getAttributeNode("type");
n.removeAttributeNode(a)
Before removing the attribute:
Hello World
After removing the attribute:
Hello World
Try it »
Definition and Usage
The removeAttributeNode() method removes the specified attribute node from the element.
This method removes (and returns) an Attr node from the current element's attribute collection. If the DTD sets a default value for the removed attribute, this method will add a new Attr node representing that default value. It is often simpler to use the removeAttribute() method instead.
You can refer to removeAttribute() method.
Browser support





All major browsers except Internet Explorer support the removeAttributeNode() method
Syntax
element
.removeAttributeNode(
attributenode
)
Parameters
| Parameters | Type | Description |
|---|---|---|
| attributenode | Attr object | Required. The attribute node you want to remove. |
Return Value
| Type | Description |
|---|---|
| Attr object | The removed attribute node |
Technical Details
| DOM version | Core Level 1 Element Object |
|---|
Element object