Latest web development tutorials

HTML DOM removeAttributeNode () method

Elements Object Reference Element object

Examples

Delete attribute nodes of the head element:

var n=document.getElementsByTagName("INPUT")[0];
var a=n.getAttributeNode("type");
n.removeAttributeNode(a)

Remove front properties:

Hello World

Remove property:

Hello World


try it"

Definition and Usage

removeAttributeNode () method Removes the specified attribute node from the elements.

The way to remove (and return to) a set of attributes Attr node from the current element. If the DTD to delete attribute sets the default value, then the method adds a new Attr node indicates the default value. With removeAttribute () method instead of the method is often easier.

You can refer to removeAttribute () method.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

In addition to Internet Explorer browsers, all major browsers support removeAttributeNode () method


grammar

element .removeAttributeNode( attributenode )

parameter

参数 类型 描述
attributenode Attr object 必须。你想移除的属性节点。

return value

类型 描述
Attr 对象 移除的属性节点

technical details

DOM version Core Level 1 Element Object


Elements Object Reference Element object