Anchor rel Property
Příklad
Vrátí hodnotu atributu rel odkazu:
var x = document.getElementById("myAnchor").rel;
Definice a použití
Vlastnost rel nastavuje nebo vrací hodnotu atributu rel odkazu.
Atribut rel určuje vztah mezi aktuálním dokumentem a propojeným dokumentem.
Podpora prohlížeče
Property | |||||
---|---|---|---|---|---|
rel | Yes | Yes | Yes | Yes | Yes |
Syntax
Vraťte vlastnost rel:
anchorObject.rel
Nastavte vlastnost rel:
anchorObject.rel = "value"
Hodnoty vlastností
Value | Description |
---|---|
alternate | An alternate version of the document (i.e. print page, translated or mirror) |
author | The author of the document |
bookmark | A related document |
help | A help document |
licence | Copyright information for the document |
next | The next document in a selection |
nofollow | "nofollow" is used by Google, to specify that the Google search spider should not follow that link (mostly used for paid links) |
noreferrer | Specifies that the browser should not send a HTTP referer header if the user follows the hyperlink |
prefetch | Specifies that the target document should be cached |
prev | The previous document in a selection |
search | A search tool for the document |
tag | A tag (keyword) for the current document |
Technické údaje
Návratová hodnota: | Řetězec představující vztah mezi aktuálním dokumentem a propojeným dokumentem |
---|
Další příklady
Příklad
Nastavte hodnotu atributu rel na "nofollow":
document.getElementById("myAnchor").rel = "nofollow";
Související stránky
HTML reference: HTML <a> rel atribut
❮ Kotevní objekt