English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Metodo focus() HTML DOM

Oggetto Elemento HTML DOM

Metodo focus()Il metodo dà al elemento la focus.

UsoMetodo blur()Il metodo rimuove il focus dall'elemento.

Sintassi:

HTMLElement.focus()
document.getElementById('myText').focus();
Prova a vedere‹/›

Compatibilità del browser

Tutti i browser supportano completamente il metodo focus():

Metodo
Metodo focus()

Dettagli tecnici

Valore di ritorno:Nessuno

Riferimenti correlati

Riferimento HTML DOM:Metodo blur()

Oggetto Elemento HTML DOM