Language References
Represents an attribute or property of an HTML element as an Attribute object. | HTML 2, 3.2, 4, 4.01, 5 |
The Attribute object is accessible via the attributes collection.
A valid attribute or property can be any Dynamic HTML property or event that applies to the object, or an expando.
Attribute Members
The following sample demonstrates the use of the Attribute object to change the value of the STYLE attribute for a UL object.
<script language="JavaScript">
function fnChangeStyle ( ) {
var oStyle = oItem1.attributes.item ( "STYLE" );
oStyle.nodeValue = "#505050";
}
</script>
<ul>
<li id="oItem1">List Item 1
</ul>