HTML and CSS Reference
In-Depth Information
THE MANY KINDS OF INPUT
One of the major new features of HTML5 is the addition of several dif erent types of input
attributes. Not only that, but the dif erent input attributes work with mobile devices. For
example, if you use an email or url input type, a special keyboard with dot ( . ) and dot-com
( .com ) appears when you begin to enter data into the form on some mobile devices.
Along with new types of input are additional attributes that af ect how your page interacts
with users. Of the 29 input attributes, 11 are new to HTML5. Like the new types of input, we
want to see how to use these attributes. Because of so many types of input and other
attributes, they've been gathered in two tables. Table 14.1 shows all the dif erent type values
you can use with the type attribute and Table 14.2 shows all the attributes, each with a short
description.
Table 14.1
Type Values for the HTML5 Input Element
Type Value
Features
Type Value
Features
button
checkbox
Action button
Selection
color *
date *
Color well
Date picker
datetime *
Date picker
datetime-local *
Date picker
email
E-mail address
file
File upload
293
hidden
image
Not displayed
Image coordinates
month *
number *
Date picker
Numeric value
password
radio
Hides password
Selection
range *
reset
Number range
Clears entries
search *
submit
Search word
Send form data
tel
text
Telephone number
String value
time *
Date picker
url *
Web address
week *
Date picker
*New to HTML5
At the time of this writing, not all these types have been implemented in the major browsers.
However, because browsers keep working to fully implement the new HTML5 standards,
don't be afraid to experiment on your own with dif erent types. Now for the general input
attributes (including type!) in Table 14.2.
Search WWH ::




Custom Search