Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM removeNamedItem() method

HTML DOM removeNamedItem() method

Attribute Object Reference Attribute object

Example

Remove the type attribute of the button:

var btn=document.getElementsByTagName("INPUT")[0]; btn.attributes.removeNamedItem("type");

Before removing the attribute:

After removing the attribute:

Try it »


Definition and Usage

The removeNamedItem() method can remove the specified node.


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the removeNamedItem() method

Note: In Internet Explorer 8 and earlier IE versions, when using the removeNamedItem() method to remove an attribute, the method cannot delete the attribute, but it can return the attribute value.


Syntax

namednodemap

.removeNamedItem(

nodename

)

Parameters

Parameters Type Description
nodename String Required. The node name you want to delete in the node list.

Return Value

Type Description
Node object The removed node

Technical Details

DOM version Core Level 1

Attribute Object Reference Attribute object