urns method (Internet Explorer)

Switch View :
ScriptFree
urns method

[This documentation is preliminary and is subject to change.]

Retrieves a collection of all objects to which a specified behavior is attached.

Syntax

object.urns(urn)

Standards information

There are no standards that apply here.

Parameters

urn

Type: VARIANT

Variant of type String that specifies the behavior's URN.

Return value

Type: Object

Returns a collection of objects if successful, or null otherwise.

Remarks

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.

Examples

The following example shows how to use the urns method to retrieve a collection of all elements currently attached to the specified behavior and then display a comma-delimited list of these element IDs in a message box.


<SCRIPT LANGUAGE="JScript">
var coll  = document.all.urns("URN1");
var sText = '';
if (coll != null)
{
    for (i=0; i<coll.length; i++) 
	   sText += coll.item(i).id + ', ';
    window.alert (sText);
}
</SCRIPT>

See also

all
anchors
applets
areas
boundElements
cells
childNodes
children
elements
embeds
form
forms
images
links
options
rows
scripts
select
styleSheets
tBodies
behaviorUrns

 

 

Build date: 3/8/2012

Community Content

Nathar Leichoz
Collection is Async
Default DHTML Behaviors have no URNs and therefore are not found in the 'document.all.urns' collection.  If you apply a Behavior dynamically, it will not be found in the 'document.all.urns' collection immediately. It will only appear after it has finished loading in IE.