autofocus attribute on a <select> tag specifies
that the select element immediately has focus upon page load.
Focus means that keyboard input is directed to that control.
<form action="/tutorial/action.html"> <select name="size" autofocus> <option value="">-- Select Size --</option> <option value="small"> Small </option> <option value="medium"> Medium </option> <option value="large"> Large </option> </select> <br/> <button type="submit">Submit</button> </form>
The autofocus attribute sets focus to the select element once the page is loaded.
Only a single element on a page can have focus.
Therefore, only one element on a page can have the
Here is when autofocus support started for each browser: