Ancora rel Proprietà
Esempio
Restituisce il valore dell'attributo rel di un collegamento:
var x = document.getElementById("myAnchor").rel;
Definizione e utilizzo
La proprietà rel imposta o restituisce il valore dell'attributo rel di un collegamento.
L'attributo rel specifica la relazione tra il documento corrente e il documento collegato.
Supporto browser
Property | |||||
---|---|---|---|---|---|
rel | Yes | Yes | Yes | Yes | Yes |
Sintassi
Restituisci la proprietà rel:
anchorObject.rel
Imposta la proprietà rel:
anchorObject.rel = "value"
Valori di proprietà
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 |
Dettagli tecnici
Valore di ritorno: | Una stringa, che rappresenta la relazione tra il documento corrente e il documento collegato |
---|
Altri esempi
Esempio
Imposta il valore dell'attributo rel su "nofollow":
document.getElementById("myAnchor").rel = "nofollow";
Pagine correlate
Riferimento HTML: attributo HTML <a> rel
❮ Ancora oggetto