HTML urn Attribute
The obsolete HTML urn attribute was historically associated with hyperlinks and was intended to provide a Uniform Resource Name that identified a linked resource independently of its location.
urn attribute is obsolete and should not be used in modern HTML. There is no direct modern HTML attribute that replaces it.
Historical Syntax
The urn attribute could be used with an <a> element in addition to the link destination specified by href.
<a href="document.html" urn="urn:isbn:9780131103627">View Document</a>
The href attribute identified where the resource could be accessed, while urn was intended to provide a persistent name for the resource.
Historical Elements
The obsolete urn attribute was historically associated with hyperlink elements.
| Element | Historical Purpose |
|---|---|
<a> |
Provided a Uniform Resource Name associated with the resource referenced by a hyperlink. |
<link> |
Provided a Uniform Resource Name associated with the resource identified by a document link. |
Historical Use
A URL commonly identifies a resource by describing where it can be accessed. A URN was designed to identify a resource by name so that its identity could remain meaningful even if its location changed.
<a href="book.html"
urn="urn:isbn:9780131103627">
View Book
</a>
In this example, href supplies the location used to follow the hyperlink, while the historical urn attribute supplies a name intended to identify the resource.
The attribute never became a dependable part of ordinary web linking and is no longer part of conforming HTML authoring.
Why It Became Obsolete
The urn attribute did not become an established mechanism for ordinary HTML hyperlinks. Modern HTML links use href to identify the destination of a hyperlink or external resource relationship.
When a resource has a persistent identifier, that identifier can be represented using the conventions appropriate to the particular identification system rather than through a separate general-purpose urn HTML attribute.
Modern Alternative
There is no direct modern HTML replacement for the obsolete urn attribute. Use the current href attribute for links and follow the requirements of any persistent identifier system being used.
Historical HTML
<a href="document.html"
urn="urn:isbn:9780131103627">
View Document
</a>
Modern HTML
<a href="document.html">View Document</a>
If a persistent identifier is itself available through a usable URI, it can be used according to the rules of that identification system. It should not be added to HTML through the obsolete urn attribute.
urn attribute and the current href attribute served different purposes. Removing urn does not mean that every historical URN value should simply be copied into href.
Legacy Browser Support
The urn attribute appeared in early HTML specifications but did not become a commonly used or dependable browser feature.
Modern webpages should not rely on the attribute. Existing legacy markup can remove it and use current hyperlink mechanisms appropriate to the resource being referenced.
For additional information about historical browser compatibility, visit Can I Use? . Search for the HTML element or attribute you want to check. Search results can include related HTML features, element attributes, APIs, and other technologies, so select the result that most closely matches the legacy feature you are researching.
Related Attributes
Other current and obsolete attributes associated with hyperlinks include:
href- Specifies the destination of a hyperlink or the URL of a linked resource.rel- Describes the relationship between the current document and a linked resource.rev- An obsolete attribute historically used to describe a reverse link relationship.methods- An obsolete attribute historically used to describe HTTP methods supported by a linked resource.
Specifications
The urn attribute is obsolete and should not be used in modern HTML. Current hyperlinks and external resource links use the href attribute to identify their destination. See the WHATWG HTML Living Standard for information about obsolete and non-conforming features.
