July 1998
Intermediate to advanced
1456 pages
65h 5m
English
setAttribute( ) — NN n/a IE 4 DOM n/a
setAttribute(attributeName,
value[,
caseSensitivity])
Sets the value of the named attribute within the current element. If the attribute is reflected in the object model as a property, this method acts the same as assigning a value to the object’s property.
None.
attributeName
The attribute name used in the HTML tag (not including the =symbol).
value
Attribute value as a string, number, or Boolean, as dictated by the attribute’s data type. Most settings are strings or stringed versions of other data types.
caseSensitivity
An optional Boolean value. If true, the attribute
in the HTML tag must match the case of the
attributeName parameter exactly for its
value to be set.
Read now
Unlock full access