Tipo di ancoraggio Proprietà
Esempio
Restituisce il tipo MIME di un collegamento specifico:
var x =
document.getElementById("myAnchor").type;
Definizione e utilizzo
La proprietà type imposta o restituisce il valore dell'attributo type di un collegamento.
L'attributo type specifica il tipo MIME dell'URL di destinazione nell'area.
Nota: l'attributo type è puramente consultivo.
Nota: l'attributo type è nuovo per l'elemento <a> in HTML5.
Supporto browser
Property | |||||
---|---|---|---|---|---|
type | Yes | Yes | Yes | Yes | Yes |
Sintassi
Restituisce la proprietà del tipo:
anchorObject.type
Imposta la proprietà del tipo:
anchorObject.type = MIME-type
Valori di proprietà
Value | Description |
---|---|
MIME-type | Specifies the MIME type of the linked document. Look at IANA MIME types for a complete list of standard MIME types. |
Dettagli tecnici
Valore di ritorno: | Una stringa, che rappresenta il tipo MIME del documento collegato |
---|
Altri esempi
Esempio
Imposta l'attributo type di un link su text/html:
document.getElementById("myAnchor").type = "text/html";
Pagine correlate
Riferimento HTML: attributo tipo HTML <a>
❮ Ancora oggetto