Oggetto collegamento DOM HTML
Oggetto di collegamento
L'oggetto Link rappresenta un elemento HTML <link>.
Accedi a un oggetto di collegamento
Puoi accedere a un elemento <link> usando getElementById():
Esempio
var x = document.getElementById("myLink");
Crea un oggetto di collegamento
Puoi creare un elemento <link> usando il metodo document.createElement():
Esempio
var x = document.createElement("LINK");
Collega le proprietà dell'oggetto
Property | Description |
---|---|
charset | Not supported in HTML5. Sets or returns the character encoding of the linked document |
crossOrigin | Sets or returns the the CORS settings of the linked document |
disabled | Sets or returns whether the linked document is disabled, or not |
href | Sets or returns the URL of the linked document |
hreflang | Sets or returns the language code of the linked document |
media | Sets or returns the media type for the link element |
rel | Sets or returns the relationship between the current document and the linked document |
rev | Not supported in HTML5. Sets or returns the reverse relationship from the linked document to the current document |
sizes | Returns the value of the sizes attribute of the linked resource |
type | Sets or returns the content type of the linked document |
Proprietà ed eventi standard
L'oggetto Link supporta anche le proprietà e gli eventi standard .
Pagine correlate
Riferimento HTML: tag HTML <link>