getAttribute Method
Last Updated: 08-18-2005
Retrieves the value of the specified attribute.

Syntax
var sValue = Element.getAttribute(sAttributeName);

Parameters
sAttributeName Required. The name of the attribute to retrieve.

Return Value
The value of the specified attribute.

Remarks
If the attribute does not exist, or if it exists but its value is the empty string (""), null is returned prior to revision 3, and an empty string is returned in revision 3 and later. Please note you cannot use getAttribute to distinguish between an unspecified attribute and an attribute whose value is the empty string. Use getAttributeNode instead, since that returns either an Attribute node or null if the attribute was not specified.
Applies To
Element
[24]7 Inc.| Terms of Service| Privacy Policy| General Disclaimers