The autofocus attribute specifies which form’s element (i.e. <input />)  should automatically get focus when the page is loaded. 

The autofocus attribute is a Boolean attribute, and it requires no value to be assigned to it.

Syntax:

<input type=”” name=”” autofocus />

Elements:

Example

The autofocus attribute example:

 

›› go to examples ››