HTML DOM Link rel Property

## JavaScript Reference

Overview

## JavaScript Objects

JS Array JS Boolean JS Date JS Math JS Number JS String JS RegExp JS Global

## Browser Objects

Window Navigator Screen History Location

## HTML DOM Objects

DOM Document DOM Elements DOM Attributes DOM Events

## HTML Objects

DOM Anchor DOM Area DOM Base DOM Body DOM Button DOM Form DOM Frame/IFrame DOM Frameset DOM Image DOM Input Button DOM Input Checkbox DOM Input File DOM Input Hidden DOM Input Password DOM Input Radio DOM Input Reset DOM Input Submit DOM Input Text DOM Link DOM Meta DOM Object DOM Option DOM Select DOM Style DOM Table DOM td / th DOM tr DOM Textarea

# Link rel Property

Link Object

## Definition and Usage

The rel property sets or returns a space-separated list that defines the relationship between the current document and the linked document.

## Syntax

Set the rel property:

linkObject.rel="relationship"

Return the rel property:

linkObject.rel

The supported relationship values are:

Value | Description
--- | ---
alternate | Linked page is an alternative version of the current document
appendix | Linked page is the appendix page for the current document
bookmark | Refers to a bookmark
chapter | Refers to a chapter
contents | Linked page is the table of contents for the current document
copyright | Linked page is the copyright/policy for the current document
glossary | Linked page is the glossary page for the current document
help | Linked page is the help page for the current document
index | Linked page is the index page for the current document
next | Refers to the next page
nofollow | The linked page should not influence the current document's ranking in search engine's index
offline | Refers to a location that contains a path to the CDF file
prev | Refers to the previous page
search | Refers to an XML file in OpenSearch description format
section | Link to a section in a list of documents
shortcut icon | Refers to an icon location
sidebar | Refers to the bookmark panel
start | Refers to the first page (used by search engines to show the first page)
stylesheet | Linked page is the style sheet for the current document
subsection | Linked page is a subsection for the current document

## Browser Support

The rel property is supported in all major browsers.

Note: The value "search" is not supported in Opera or Safari.

Note: The value "sidebar" is not supported in IE, Safari, or Chrome.

## Example

Display the relationship between the current document and the linked document:

<html>
<head>
<link id="link1" rel="stylesheet" type="text/css" href="style1.css">
<script>
function displayResult()
{
var x=document.getElementById("link1").rel;
alert(x);
}
</script>
</head>
<body>
<button type="button" onclick="displayResult()">Display relationship</button>
</body>
</html>
Try it yourself »

Link Object

## Your suggestion:

Your E-mail (optional):

Page address:

Description:

Close [X]

## Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

## WEB HOSTING

Best Web Hosting UK Reseller Hosting Wow! $5 SSD Hosting

## WEB BUILDING

Download XML Editor
FREE Website BUILDER FREE Website Creator

## WEB RESOURCES

Web Statistics Web Validation

## SHARE THIS PAGE