November 2011
Intermediate to advanced
384 pages
13h 23m
English
You can use the autofocus input attribute to automatically move the user’s cursor, or insertion point, directly to any input field as soon as the web page loads. This is useful to direct the user to input fields that are required to be populated early after the page loads, such as a username field:
<input ... autofocus>
The autofocus attribute activates the auto-focus feature in the user’s web browser, if supported. The attribute does not require a value — in fact, its value can be anything; the browser only looks for the attribute name to enable the feature. This means that you could use the value on if it makes better sense to you; however, even if you set autofocus=off, it will still be enabled! The browser ...
Read now
Unlock full access