You are here: Reference > JavaScript > client-side > HTML DOM > properties > tagUrn

tagUrn property

Browser support:
Sets or retrieves the Uniform Resource Name (URN) of the namespace declared for the current element.
Namespaces can be defined by the xmlns attribute in HTML documents.
Use the scopeName property to get the local name of a namespace declared for an element.

Syntax:

object.tagUrn;
You can find the related objects in the Supported by objects section below.
This property is read/write.

Possible values:

String that specifies or retrieves the Uniform Resource Name (URN) of the namespace, or null for standard HTML tags.
Default: this property has no default value.

Example HTML code 1:

This example illustrates the use of the tagUrn property:
Code
hover.htc
<html xmlns:myNS="http://help.dottoro.com/NS">
<head>
    <script type="text/javascript">
        var namespace = document.namespaces("myNS");
        namespace.doImport("hover.htc");

        function GetNSInfo () {
            var myTag = document.getElementById ("myTag");
            alert ("The local name of the namespace is " + myTag.scopeName);
            alert ("The URN of the namespace is " + myTag.tagUrn);
        }
    </script>
</head>
<body>
    <myNS:span id="myTag">Move the mouse over this text (element with behavior)</myNS:span><br />
    <span>Move the mouse over this text (element without behavior)</span>
    <br /><br />
    Click on the following button to get information about the namespace declared for the 'element with behavior'.
    <br />
    <button onclick="GetNSInfo ()">Get information about the namespace</button>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content