New Input Types

In HTML 4.01, a handful of form elements allowed user input, including textarea, checkbox, and radio, but the most common was without a doubt input, most often with a type attribute value of text. This hard-working field (from here on known as the text input) was used in every situation in which a specialized control was unavailable: as a search box, for telephone numbers and email addresses … you name it, the text input did it, with only some client- or server-side validation to give meaning to the different types of data being provided by the user.

When work on HTML5 was underway, with its stated emphasis on standardizing common patterns of existing usage, creating new input types to lift some of the burden from the encumbered ...

Get The Modern Web now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.