Attributo di messa a fuoco automatica <pulsante> HTML

❮ Tag HTML <pulsante>

Esempio

Un pulsante con autofocus:

<button type="button" autofocus>Click Me!</button>

Definizione e utilizzo

L' autofocusattributo è un attributo booleano.

Quando presente, specifica che un pulsante deve essere attivato automaticamente al caricamento della pagina.


Supporto browser

I numeri nella tabella specificano la prima versione del browser che supporta completamente l'attributo.

Attribute
autofocus 5.0 10.0 4.0 5.0 9.6

Sintassi

<button type="button" autofocus>

❮ Tag HTML <pulsante>