New HTML5 Input Types and Attributes
New HTML5 Input Types and AttributesHTML5 defines a variety of new input types: sliders, number spinners, popup calendars, color choosers, autocompleting suggest boxes, and more. The beauty of these elements is that you can use them now: for browsers that don't support a particular input type, there is automatic fallback to standard textfields. There are two keys to understanding why the automatic fallback works consistently in all major browsers:
- The default type for input elements is "text".
- All browsers ignore unknown attributes.
<input type="foo" bar="baz"/>, all browsers will treat this identically to
<input type="text"/>(unless "foo" is a recognized input type or "bar" is a recognized attribute of the input element). For each of the new input types, we present a high-level description, an overview of the syntax, a description of the main attributes, a summary of which current browsers support it, and an example you can experiment with in your browser. Please send corrections and suggested improvements to firstname.lastname@example.org.