April 2013
Intermediate to advanced
264 pages
7h 44m
English
Before moving on to discuss more input types, I want to make a brief digression to talk about some of the many new attributes. These attributes bring some useful and crucial new properties and behavior to HTML forms and, once again, are based on popular script libraries and workarounds created by developers and made official as part of HTML5.
The autofocus attribute, which is common to all input types, simply sets the focus on the specified element when the page is loaded. In a text input field, for example, the cursor would already be placed and ready for the user’s input. autofocus is a Boolean attribute, so the value to activate it can be either autofocus or just left out entirely, as shown here:
<input type="text" ...
Read now
Unlock full access