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

rel property (a, link)

Browser support:
Specifies or returns the relationship between the current document and the destination of an anchor or link.
This property contains information for the author only, there isn't any functionality assigned to this property.

Syntax:

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

Possible values:

String that sets or retrieves a space-separated list of relation types.
The list of the supported relation types:
Alternate
Designates substitute versions for the document in which the link occurs.
Appendix
Page that is an appendix for the set of pages.
Bookmark
Bookmark.
Chapter
Refers to a document serving as a chapter in a collection of documents.
Contents
Refers to a document serving as a table of contents.
Copyright
Copyright notice.
Glossary
Glossary for the page.
Help
Help document.
Index
Refers to a document providing an index for the current document.
Next
Refers to the next document in a sequence.
Nofollow
Instruct search engines that the current document has no effect on the page ranking of the linked document.
Offline
Location that contains a path to the CDF file.
Prev
Refers to the previous document in a sequence.
Search
Referes to an XML file in OpenSearch description format.
Section
Page that is a section for a set of pages.
Shortcut Icon
Refers to an icon location.
sidebar
Refers to the bookmarks panel. Only works with Opera and Firefox.
Start
Refers to the first document.
Stylesheet
Refers to an external style sheet.
Subsection
Page that is a subsection for a set of pages.
Default: this property has no default value.

Example HTML code 1:

This example illustrates the use of the rel attribute:
Code
style.css
<head>
    <link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
    Some text content
</body>
Did you find this example helpful? yes no

Example HTML code 2:

This example shows how to tell the client's browser that you offer a search plugin from HTML. If the search provider is currently installed it will be selected search engine. Note that the AddSearchProvider method provides similar functionality in JavaScript.
Code
searchProvider.xml
<head>
    <link rel="search" type="application/opensearchdescription+xml" href="searchProvider.xml" title="Dottoro Search" /> 
</head>
<body>
    Please open the drop-down menu of your browser's Search Box.
</body>
Did you find this example helpful? yes no

Example HTML code 3:

This example illustrates the use of the rel property:
Code
style.css
<head>
    <link id="baseStyles" rel="stylesheet" type="text/css" href="style.css" />
    <script type="text/javascript">
        function GetRelationType () {
            var link = document.getElementById ("baseStyles");
            alert (link.rel);
        }
    </script>
</head>
<body>
    Some text content
    <button onclick="GetRelationType ();">Get relation!</button>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content