HTML and CSS Reference
The month input type
Using <input type=month> allows entry and validation of a
month. Although the month value is stored internally as a number
between 1 and 12, the browser may offer a selection method that
uses the names of the months instead. You could do this with a
select box with 12 options, January to December, but this doesn't
localise. Using an HTML5 month input type, a French-localisation
of a browser could offer a drop-down with Janvier instead of
January, for example. That's more work for the browser and less
work for web developers, and that's the way it should be.
The week input type
<input type=week> allows entry and validation of a week num-
ber. While this could be a simple input field allowing a user to
input a number, it's more complex in practice: some years have
53 weeks. Therefore, the format is 2010-W07 for the seventh
week in the year 2010.
Opera offers a date picker UI, which populates the input field
with the week number of any selected date rather than the
dates YYYY-MM-DD format ( Figure 3.5 ).
FIguRE 3.5 Opera's rendering
of <input type=week> .
The number input type
Not surprisingly, <input type=number> validates numeric entry.
It is not meant for telephone numbers, as these are often typed
with spaces, brackets, plus signs, hyphens etc; use <input
type=tel> for those.