removeNamedItem method
[This documentation is preliminary and is subject to change.]
Removes an attribute specified with the name property from an element by using the attributes collection.
![]() |
Syntax
var retval = attributes.removeNamedItem(bstrName);Standards information
Parameters
Return value
Type: ObjectReturns an attribute removed from the document if successful, otherwise null.Remarks
An attribute that is removed with this method reverts to the default value of the attribute when applicable. This method returns a script error if the user attempts to remove a non-existent attribute node.
removeNamedItem was introduced in Microsoft Internet Explorer 6.
Examples
The following example shows how to use this method to remove an attribute from an element.
Code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/removeNamedItemEx1.htm
<HTML>
<HEAD>
<SCRIPT>
function removeAttrib()
{
var oAttrColl = myDIV.attributes;
oAttrColl.removeNamedItem("TITLE");
}
</SCRIPT>
</HEAD>
<BODY>
<DIV onclick="removeAttrib();" ID="myDIV" TITLE="THIS IS A TOOLTIP">
Click this DIV and the ToolTip will be inactivated.</DIV>
</BODY>
</HTML>
Build date: 2/14/2012
