Attributo nome IFrame
Definizione e uso
name
L'attributo setta o restituisce l'elemento iframe Attributo name Il valore.
L'attributo name definisce il nome dell'iframe, che può essere utilizzato per referenziare l'elemento in JavaScript o come valore per questi attributi:
- L'attributo target dell'elemento <a> o <form>
- L'attributo formtarget dell'elemento <input> o <button>
Esempio
Esempio 1
Ottieni il nome dell'iframe:
var x = document.getElementById("myFrame").name;
Esempio 2
Modifica il nome dell'iframe:
document.getElementById("myFrame").name = "newIframeName";
Sintassi
Restituire l'attributo name:
iframeObject.name
Impostare l'attributo name:
iframeObject.name = name
Valore dell'attributo
Valore | Descrizione |
---|---|
name | Il nome dell'<iframe>. |
Dettagli tecnici
Valore di ritorno: | Valore di stringa che rappresenta il nome dell'<iframe>. |
---|
Supporto browser
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Supporto | Supporto | Supporto | Supporto | Supporto |
Pagine correlate
Manuale di riferimento HTML:Proprietà name dell'<iframe> HTML