Click to return to the DHTML, HTML     
AREA Element | AREA Objec...     B Element | B Object     DHTML Objects    
Web Workshop  |  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!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.