Customizing the Input Element

  • Adam Freeman


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 can be used with only certain type values. I’ll explain all of the different types and the associated attributes in this chapter. Table 13-1 provides the summary for this chapter.


Additional Attribute Option Element Input Element Input Validation Radio Button 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Adam Freeman 2011

Authors and Affiliations

  • Adam Freeman

There are no affiliations available

Personalised recommendations