getAttribute Method

New for Windows Internet Explorer 8

Note: This documentation is preliminary and is subject to change.

Retrieves the value of the specified attribute.

Syntax

vAttrValue = object.getAttribute(sAttrName, iFlags)

Parameters

> > >
sAttrName Required. String that specifies the name of the attribute.
iFlags Required. Integer that specifies one or more of the following flags:
0 Performs a property search that is not case-sensitive.
1 Performs a case-sensitve property search. To find a match, the uppercase and lowercase letters in sAttrName must exactly match those in the attribute name.
2 Default. Returns the value exactly as it was set in script or in the source document.

Return Value

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

Remarks

The specified attribute names will always retrieve their appropriate string values.

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, ISINDEX, KBD, LABEL, LEGEND, LI, LINK, LISTING, MAP, MARQUEE, MENU, nextID, NOBR, NOFRAMES, NOSCRIPT, OBJECT, OL, OPTION, P, PLAINTEXT, PRE, Q, RT, RUBY, 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, XML, XMP

See Also

hasAttribute