www.fgks.org   »   [go: up one dir, main page]

Skip Navigation Links
  

Microsoft Developer Network

Click to Rate and Give Feedback
Methods
 removeNamedItem Method
removeNamedItem Method

Removes an attribute specified with the name property from an element by using the attributes collection.

Syntax

newretNode = attributes.removeNamedItem(sName)

Parameters

sName Required. A String that specifies the name of an attribute to remove.

Return Value

Returns an attribute removed from the document if successful, otherwise null.

Remarks

removeNamedItem was introduced in Microsoft Internet Explorer 6.

An attribute that is removed with this method reverts to the default value of the attribute when applicable.

Example

The following example shows how to use the this method to remove an attribute from an element.

<HTML>
<HEAD>
<SCRIPT>
function removeAttrib()
{
    var oAttrColl = myDIV.attributes;
    oAttrColl.removeNamedItem("TITLE");
}
</SCRIPT>
</HEAD>
<BODY>
<DIV  ID="myDIV" TITLE="THIS IS A TOOLTIP">
Click this DIV and the ToolTip will be inactivated.</DIV>
</BODY>
</HTML>
This feature requires Microsoft® Internet Explorer 6 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

Standards Information

This method is defined in World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 World Wide Web link.

Applies To

attributes
Tags What's this?: Add a tag
Community Content
 
Add Community Content
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker
DCSIMG