DHTML Methods
Retrieves a collection of objects to which a specified behavior is attached.
collObjects = object.urns ( "sUrn" )
sUrn |
Required. String specifying a behavior's Uniform Resource Name ( URN ). |
Returns a collection of objects if successful, or null otherwise.
This method returns an empty collection if no element has the specified behavior attached to it.
Use the length property on the collection to determine the number of elements it contains, and the item method to obtain a particular item in the collection.
The following JScript ( compatible with ECMA-262 language specification ) example retrieves a collection of all P elements in the document and then applies an underline to each.
var coll = document.all.urns ( "/sample/ul.htc" );
if ( coll!=null ) {
for ( i=0; i<coll.length; i++ )
alert ( coll.item ( i ).tagName );
}
all, areas, elements, forms, SELECT
behaviorUrns