Attribute Object

MS Office DHTML, HTML & CSS

Attribute Object


Represents an attribute or property of an HTML element as an object.

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.

This object is available in script as of Microsoft® Internet Explorer 5.

Members

Example

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 = "oItem1" ACCESSKEY = "L">List Item 1
</UL>


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? write us!Internet Link

© 1999 microsoft corporation. all rights reserved. terms of useInternet Link.