2.3.2.1 getAttribute

Retrieves the value of the specified attribute.

Syntax

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

Parameters

sAttrName of type DOMString

A required string that specifies the name of the attribute.

iFlags of type integer

Optional. Integer that specifies one or more of the following flags:

0

Default. Performs a property search that is not case-sensitive, and returns an interpolated value if the property is found.

1

Performs a case-sensitive property search. To find a match, the uppercase and lowercase letters in sAttrName must exactly match those in the attribute name.

2

Returns attribute value as a string. This flag does not work for event properties.

4

Returns attribute value as a fully expanded URL. Only works for URL attributes. 

Return Value

If the attribute is not present, this method returns null.

No Errors

Show: