Anker rel Property
Voorbeeld
Retourneer de waarde van het rel-attribuut van een link:
var x = document.getElementById("myAnchor").rel;
Definitie en gebruik
Met de eigenschap rel wordt de waarde van het rel-attribuut van een link ingesteld of geretourneerd.
Het rel attribuut specificeert de relatie tussen het huidige document en het gekoppelde document.
Browserondersteuning
Property | |||||
---|---|---|---|---|---|
rel | Yes | Yes | Yes | Yes | Yes |
Syntaxis
Retourneer de eigenschap rel:
anchorObject.rel
Stel de eigenschap rel in:
anchorObject.rel = "value"
Eigendomswaarden
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 |
Technische details
Winstwaarde: | Een tekenreeks, die de relatie weergeeft tussen het huidige document en het gekoppelde document |
---|
Meer voorbeelden
Voorbeeld
Stel de waarde van het rel attribuut in op "nofollow":
document.getElementById("myAnchor").rel = "nofollow";
Gerelateerde pagina's
HTML-referentie: HTML <a> rel-attribuut
❮ Ankerobject