Documento HTML DOM activeElement
❮
❯
Esempio
Ottieni l'elemento attualmente focalizzato:
const element = document.activeElement.tagName;
Definizione e utilizzo
La activeElement
proprietà restituisce l'elemento HTML che ha lo stato attivo.
La activeElement
proprietà è di sola lettura.
Sintassi
document.activeElement
Valore di ritorno
Tipo | Descrizione |
Elemento | L'elemento HTML che ha lo stato attivo |
Supporto browser
document.activeElement
è una funzionalità DOM di livello 1 (1998).
È completamente supportato in tutti i browser:
Chrome | IE | Edge | Firefox | Safari | Opera |
Yes | 9-11 | Yes | Yes | Yes | Yes |
❮
❯