You are here: Reference > JavaScript > client-side > style handling > methods > urns (all, anchors, areas, ...)

urns method (all, anchors, areas, ...)

Browser support:
Returns a NodeList collection that contains all elements to which the specified behavior is attached.
Behaviors can be attached to elements with the behavior style property and the addBehavior method or to namespaces with the doImport method.
Perhaps for security reasons, behaviors cannot be accessed by Uniform Resource Names; therefore the urns method always returns an empty collection.


object.urns (URN);
You can find the related objects in the Supported by objects section below.


Required. String that specifies the Uniform Resource Name (URN) of the behavior.

Return value:

Returns a NodeList collection that contains the matching elements.

Example HTML code 1:

This example illustrates the use of the urns method:
    <script type="text/javascript">
        function GetElementsByBehavior () {
            var elems = document.all.urns ("");
                // the elems.length is always zero
            alert ("There is " + elems.length + " matching element in the document.");
    <span id="mySpan" style="behavior: url('')">
        Move the mouse over this text (element with behavior)
    <br /><br />
    <button onclick="GetElementsByBehavior ();">Get elements by behavior</button>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content