C H A P T E R  13

Customizing the Input Element

In the previous chapter, I showed you the basic use of the input element, which produced a simple text box in which the user can enter data. The problem with this approach is that the user can enter any data. This can be fine in some situations, but in other cases you might want a specific kind of data value from the user. In such cases, you can configure the input element to collect data from users in different ways. You configure the input element through the type attribute, for which there are 23 different values in HTML5. After you have selected the type value you want, you have access to additional attributes. There are 30 attributes available for the input element in total, and many of these ...

Get The Definitive Guide to HTML5 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.