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

Click to Rate and Give Feedback
Methods
 clearAttributes Method
clearAttributes Method

Removes all attributes and values from the object.

Syntax

object.clearAttributes()

Return Value

No return value.

Remarks

The clearAttributes method clears only persistent HTML attributes. The ID attribute, styles, and script-only properties are not affected.

Example

This example uses the clearAttributes method to remove user-defined attributes from an element.

<SCRIPT>
function fnClear(){
   oSource.children[0].clearAttributes();
}
</SCRIPT>

<SPAN ID=oSource>
<DIV
   ID="oDiv"
   ATTRIBUTE1="true"
   ATTRIBUTE2="true"
   
   
   
>
This is a sample <b>DIV</b> element.
</DIV>
</SPAN>

<INPUT
   TYPE="button"
   VALUE="Clear Attributes"
   
>
This feature requires Microsoft® Internet Explorer 5 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

Standards Information

There is no public standard that applies to this method.

Applies To

A, ABBR, ACRONYM, ADDRESS, APPLET, AREA, B, BASE, BASEFONT, BDO, BGSOUND, BIG, BLOCKQUOTE, BODY, BR, BUTTON, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, COMMENT, CUSTOM, DD, DEL, DFN, DIR, DIV, DL, DT, EM, EMBED, FIELDSET, FONT, FORM, FRAME, FRAMESET, HEAD, hn, HR, HTML, I, IFRAME, IMG, INPUT type=button, INPUT type=checkbox, INPUT type=file, INPUT type=hidden, INPUT type=image, INPUT type=password, INPUT type=radio, INPUT type=reset, INPUT type=submit, INPUT type=text, INS, KBD, LABEL, LEGEND, LI, LINK, LISTING, MAP, MARQUEE, MENU, nextID, OBJECT, OL, OPTION, P, PLAINTEXT, PRE, Q, S, SAMP, SCRIPT, SELECT, SMALL, SPAN, STRIKE, STRONG, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TITLE, TR, TT, U, UL, VAR, XMP

See Also

mergeAttributes, About the W3C Document Object Model
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