getAttribute Method

DHTML, HTML, & CSS

getAttribute Method


Retrieves the value of the specified attribute.

Syntax

vAttrValue = object.getAttribute(sAttrName [, iFlags])

Parameters

sAttrNameRequired. String that specifies the name of the attribute.
iFlagsOptional. Integer that specifies one or more of the following flags:
0Default. Performs a property search that is not case-sensitive, and returns an interpolated value if the property is found.
1Performs a case-sensitive property search. To find a match, the uppercase and lowercase letters in sAttrName must exactly match those in the attribute name. If the iFlags parameter for setAttribute is set to true and this option is set to 0 (default), the specified property name might not be found.
2Returns the value exactly as it was set in script or in the source document.

Return Value

Variant. Returns a string, number, or Boolean value as defined by the attribute. If the attribute is not present, this method returns null.

Remarks

If two or more attributes have the same name (differing only in uppercase and lowercase letters) and iFlags is 0, the getAttribute method retrieves values only for the last attribute created with this name, and ignores all other attributes with the same name.

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
Version data is listed when the mouse hovers over a link, or the link has focus.
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, 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!Internet Link

© 1999 microsoft corporation. all rights reserved. terms of useInternet Link.