You are here: Reference > JavaScript > client-side > style handling > methods > urns (all, anchors, areas, ...)
urns method (all, anchors, areas, ...)
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.
Perhaps for security reasons, behaviors cannot be accessed by Uniform Resource Names; therefore the urns method always returns an empty collection.
Syntax:
You can find the related objects in the Supported by objects section below.
Parameters:
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:
|
|||||
<head> <script type="text/javascript"> function GetElementsByBehavior () { var elems = document.all.urns ("hover.htc"); // the elems.length is always zero alert ("There is " + elems.length + " matching element in the document."); } </script> </head> <body> <span id="mySpan" style="behavior: url('hover.htc')"> Move the mouse over this text (element with behavior) </span> <br /><br /> <button onclick="GetElementsByBehavior ();">Get elements by behavior</button> </body> |
|||||
|
|||||
Did you find this example helpful?
|
Supported by objects:
all, anchors, applets, areas, boundElements, cells, children, elements, embeds, forms, images, links, NodeList, options, rows, scripts, tBodies
HTML elements:
Related pages:
External links:
User Contributed Comments