HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

HTML DOM removeNamedItem() Method

Attribute Object Reference Attribute Object

Example

Remove the type attribute from an input button:

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

Before removing the attribute:

After removing the attribute:


Try it yourself »

Definition and Usage

The removeNamedItem() method removes the node with the specified name in a namedNodeMap.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The removeNamedItem() method is supported in all major browsers.

Note: In Internet Explorer 8 and earlier, when using the removedNamedItem method to remove an attribute, the method returns the attribute as it should, but it does not remove the attribute.


Syntax

namednodemap.removeNamedItem(nodename)

Parameters

Parameter Type Description
nodename String Required. The name of the node in the namedNodeMap you want to remove

Return Value

Type Description
Node object The node that was removed

Technical Details

DOM Version Core Level 1


Attribute Object Reference Attribute Object


Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE