You are here: Reference > JavaScript > client-side > HTML DOM > properties > urn (a)

urn property (a)

Browser support:
Specifies or returns a Uniform Resource Name (URN) for a linked object.
The URN provides the identity, while the URL specifies an address to find it.

Syntax:

object.urn;
You can find the related objects in the Supported by objects section below.
This property is read/write.
HTML page for this property: urn

Possible values:

String that sets or retrieves a Uniform Resource Name.
Default: this property has no default value.

Example HTML code 1:

This example illustrates the use of the URN attribute:
<a href="http://www.dottoro.com" urn="myAnchor"></a>
Did you find this example helpful? yes no

Example HTML code 2:

This example illustrates the use of the URN property:
<head>
    <script type="text/javascript">
        function GetUrn () {
            var anchor = document.getElementById ("myAnchor");

            if ('urn' in anchor) {
                alert (anchor.urn);
            } else {
                alert ("Your browser doesn't support this example!");
            }
        }
    </script>
</head>
<body>
    <a id="myAnchor" href="http://www.dottoro.com" urn="anchor">a sample link element</a>
    <br />

    <button onclick="GetUrn ();">Get the value of the anchor's URN property!</button>
</body>
Did you find this example helpful? yes no

Supported by objects:

External links:

User Contributed Comments

Post Content

Post Content