
HTML5 New Input Types
HTML5 has several new input types
for forms. These new features allow better input control and validation.
This chapter covers the new input types:
color
date
datetime
datetime-local
email
month
number
range
search
tel
time
url
week
Note: Not all major browsers support all the new
input types. However, you can already start using them; If
they are not supported, they will behave as regular text fields.
Input Type: color
The color type is used for input fields that should contain a color.
Example
Select a color from a color picker:
Select your favorite color: <input type="color" name="favcolor" />
Input Type: date
The date type allows the user to select a date.
Example
Define a date control:
Birthday: <input type="date" name="bday" />
Input Type: datetime
The datetime type allows the user to select a date and time (with time zone).
Example
Define a date and time control (with time zone):
Birthday...