autofocus
Summary
Provides a way to direct a user to a specific field when a document loads.
Applies to | [HTMLInputElement](/html/elements/input) |
---|
This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens.
This attribute is true when present on an element, and false when missing. Only one element on each page can have the autofocus field.
Examples
<input id="search_box" autofocus>
Related specifications
- HTML5
- W3C Candidate Recommendation
See also
Related articles
HTML
autofocus
External resources
Related pages
- HTMLButtonElementHTMLButtonElement
- HTMLInputElementHTMLInputElement
- HTMLSelectElementHTMLSelectElement
- HTMLTextAreaElementHTMLTextAreaElement
Attributions
Microsoft Developer Network: [Windows Internet Explorer API reference Article]