HTML DOM Anchor rel and rev Properties

## 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

# Anchor rel and rev Properties

Anchor Object

## Definition and Usage

The rel property sets or returns the value of the rel attribute of a link.

The rev property sets or returns the value of the rev attribute of a link.

The rel attribute specifies the relationship between the current document and the linked document.

The rev attribute specifies the relationship between the linked document and the current document.

## Syntax

Set the rel property:

anchorObject.rel="relationship"

Set the rev property:

anchorObject.rev="relationship"

Return the rel property:

anchorObject.rel

Return the rev property:

anchorObject.rev

Both properties can have one of the following values:

Value | Description
--- | ---
alternate | An alternate version of the document (i.e. print page, translated or mirror)
stylesheet | An external style sheet for the document
start | The first document in a selection
next | The next document in a selection
prev | The previous document in a selection
contents | A table of contents for the document
index | An index for the document
glossary | A glossary (explanation) of words used in the document
copyright | A document containing copyright information
chapter | A chapter of the document
section | A section of the document
subsection | A subsection of the document
appendix | An appendix for the document
help | A help document
bookmark | A related document
nofollow | "nofollow" is used by Google, to specify that the Google search spider should not follow that link (mostly used for paid links)
licence |
tag |
friend |

## Browser Support

The rel and rev properties are supported in all major browsers.

Note: Browsers do not use these properties in any way. However, search engines can use these properties to get more information about a link.

## Example

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

<html>
<body>
<a id="func" rel="friend"
href="http://www.functravel.com/">Cheap Flights</a>
<script>
document.write(document.getElementById("func").rel);
</script>
</body>
</html>

The output of the code above will be:

friend
Try it yourself »

Anchor 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