DHTML Collections
Returns a collection of Uniform Resource Name ( URN ) strings identifying the behaviors attached to the element.
[ collUrns = ] object.behaviorUrns |
[ sUrn = ] object.behaviorUrns ( iIndex ) |
collUrns |
Specifies an array of URNs identifying the behaviors attached to the element. |
sUrn |
Specifies an item in the array of behavior URNs. |
iIndex |
Required. Integer indicating the zero-based index of the item to be returned from the collection. |
A behavior can specify a unique identifier in the form of an URN. If no URN is specified for a behavior, an empty string is specified in the collection. If no behaviors are attached to the element, an empty collection is returned.
The following example displays the URN of every behavior attached to a specified DIV.
<head>
<style>
div {
behavior:url( fly.htc ) url( zoom.htc ) url( fade.htc ) }
</style>
<script language="JavaScript">
<!--
function window.onload ( ) {
oColl = oDiv.behaviorUrns;
if oColl != null {
for ( i = 0; i < oColl.length; i ++ )
alert ( oColl ( i ) );
}
}
//-->
</script>
</head>
...
<div id="oDiv">I just want to fly</div>
behavior Attribute