Esempio
Ottenere il nome di un iframe:
var x = document.getElementById("myFrame").name;
Il risultato di x sarà:
iframe_a
Prova tu stesso " Definizione e l'utilizzo
Insiemi di proprietà il nome o restituisce il valore del name dell'attributo in un elemento IFRAME.
Il name attributo specifica il nome di un iframe, e può essere utilizzato per fare riferimento all'elemento in JavaScript, o come il valore del target attributo di un <a> o <form> elemento, o formtarget attributo di un <input> o <button> elemento.
Supporto browser
Proprietà | |||||
---|---|---|---|---|---|
name | sì | sì | sì | sì | sì |
Sintassi
Restituire la proprietà nome:
iframeObject .name
Impostare la proprietà nome:
iframeObject .name= name
I valori delle proprietà
Valore | Descrizione |
---|---|
name | Il nome del iframe |
Dettagli tecnici
Valore di ritorno: | A String, che rappresenta il nome del iframe |
---|
Altri esempi
Esempio
Cambiare il nome di un iframe:
document.getElementById("myFrame").name = "newIframeName";
Prova tu stesso " Pagine correlate
Di riferimento HTML: HTML <iframe> attributo name
<Oggetto IFrame