attribute object
[This documentation is preliminary and is subject to change.]
Represents an attribute or property of an HTML element as an object.
Standards information
There are no standards that apply here.
Remarks
The attribute object is accessible through the attributes collection.
A valid attribute or property can be any Dynamic HTML (DHTML) property or event that applies to the object, or an expando.
When displaying a Web page in IE8 Standards mode, Windows Internet Explorer distinguishes between attribute values specified by the original page author and the representation of those values in the Document Object Model (DOM). For more information, see Attribute Differences in Internet Explorer 8.
This object is available in script as of Microsoft Internet Explorer 5.
Examples
This example uses the attribute object to create a list of attributes that are specified.
<SCRIPT>
function fnFind(){
for(var i=0;i<oList.attributes.length;i++){
if(oList.attributes[i].specified){
alert(oList.attributes[i].nodeName + " = "
+ oList.attributes[i].nodeValue);
}
}
}
</SCRIPT>
<UL onclick="fnFind()">
<LI ID = "oList" ACCESSKEY = "L">List Item 1
</UL>
Build date: 3/8/2012