Using the input Element to Restrict Data Entry

HTML5 introduces new values for the input element's type attribute. Those values let you be more specific about the kind of data that you want from the user.

The following table lists those values:

TypeRestricts the input toNew in HTML5
checkboxto a true/false check box.No
colora color.Yes
datea date.Yes
datetimea global date and time with time zone.Yes
datetime-locala global date and time without time zone.Yes
emaila properly formatted e-mail address.Yes
montha year and month.Yes
numberan integer or floating-point number.Yes
radiobuttona fixed set of choices.No
rangea specified range.Yes
tela properly formatted telephone number.Yes
timea time of day.Yes
weeka year and week.Yes
urla fully qualified URL.Yes
Home 
  HTML CSS Book 
    HTML  

input Restricted:
  1. Using the input Element to Restrict Data Entry
  2. Using the input element to obtain a number
  3. Using input Element to Obtain a Number in a Given Range
  4. Using the input Element to Obtain a Boolean Response
  5. Using the input Element to Create Fixed Choices
  6. Using the input Element to Obtain email address
  7. Using the input element to obtain telephone number
  8. Using the input Element to Obtain url
  9. Using the input element to obtain times and dates
  10. Using the input Element to Obtain a Color
  11. Using the input Element to Obtain Search Terms
  12. Using the input element to create hidden data items
  13. Using the input Element to Create Image Buttons and Maps
  14. Using the input element to upload files
Related: