Click to return to the DHTML, HTML     
select Method     setCapture Method     DHTML Methods    
Web Workshop  |  DHTML, HTML & CSS

setAttribute Method


Sets the value of the specified attribute.

Syntax

object.setAttribute(sName, vValue [, iFlags])

Parameters

sName Required. String that specifies the name of the attribute.
vValue Required. Variant that specifies the string, number, or Boolean to assign to the attribute.
iFlags Optional. Integer that specifies one or more of the following flags:
0When the attribute is set, it overwrites any attributes with the same name, regardless of their case.
1Default. The case of the attribute that you set is respected when it is set on the object.

Return Value

No return value.

Remarks

If the specified attribute is not already present, the setAttribute method adds the attribute to the object and sets the value.

Be careful when spelling attribute names. If you set iFlags to 1 and the sName parameter does not have the same uppercase and lowercase letters as the attribute, a new attribute is created for the object.

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
A, ADDRESS, APPLET, AREA, B, BASE, BASEFONT, BGSOUND, BIG, BLOCKQUOTE, BODY, BR, BUTTON, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, COMMENT, custom, DD, 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, KBD, LABEL, LEGEND, LI, LINK, LISTING, MAP, MARQUEE, MENU, META, NEXTID, NOBR, OBJECT, OL, OPTION, P, PLAINTEXT, PRE, S, SAMP, SCRIPT, SELECT, SMALL, SPAN, STRIKE, STRONG, STYLE, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TITLE, TR, TT, U, UL, VAR, WBR, XMP


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.