NamedNodeMap.removeNamedItem() (Method)

Given that you know the name of an item, you can locate and remove it from the collection. If necessary, the item is replaced by another containing the default attribute settings.


DOM level - 1
JavaScript - 1.5
JScript - 5.0
Internet Explorer - 5.0
Netscape - 6.0
Property/method value type:Node object
JavaScript syntax:-myNamedNodeMap.removeNamedItem(aName)
Argument list:aNameAn associative array reference

The value returned is a reference to the node that was removed. The same rules used for the getNamedItem() method apply. If no item is found then a null is returned instead. Multiple matching nodes may result in unpredictable and implementation specific results.

If this node is not referred to by any other means and you do not assign the value to a variable, then the node will become detached and no longer has an owner. You will have no way to locate that node again without reconstructing the document. The object representing the node should in due course be garbage collected automatically.