Esempio
Riportare la relazione tra il documento corrente e il documento collegato:
var x = document.getElementById("myLink").rel;
Il risultato di x sarà:
stylesheet
Prova tu stesso " Definizione e utilizzo
Gli insiemi di proprietà rel o restituisce un elenco separato da spazi che definisce la relazione tra il documento corrente e il documento collegato.
Supporto per il browser
La proprietà rel è supportata in tutti i principali browser.
Nota: Il valore di "ricerca" non è supportato in Opera o Safari.
Nota: Il valore "barra laterale" non è supportato in IE, Safari o Chrome.
Sintassi
Restituisce la proprietà rel:
linkObject .rel
Impostare la proprietà rel:
linkObject .rel=relationship
I valori delle proprietà
Value | Description |
---|---|
alternate | Linked page is an alternative version of the current document |
appendix | Linked page is the appendix page for the current document |
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 |
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 |
Dettagli tecnici
Valore di ritorno: | Una stringa, che rappresenta un elenco separato da spazi di tipi di relazione |
---|
Pagine correlate
Di riferimento HTML: HTML <link> attributo rel
