What are the new input types provided by HTML 5 for forms?

Asked: Apr 15, 2023

Following are the important, new input types for forms provided by HTML 5:

  1. color – Used for fields that should contain colour.
  2. date – Allows the user to select a date.
  3. datetime - Allows the user to select a date and time (with time zone).
  4. datetime-local - Allows the user to select a date and time (without time zone).
  5. email - Used for input fields that should contain an e-mail address.
  6. month - Allows the user to select a month and year.
  7. number - Used for input fields that should contain a numeric value. Restrictions on type of numbers accepted can be set.
  8. range - Used for input fields that should contain a value from a range of numbers. Restrictions on type of numbers accepted can be set here as well.
  9. search - Used for search fields.
  10. tel - Defines a field for entering a telephone number.
  11. time - Allows the user to select a time.
  12. url - Used for input fields that should contain a URL address.
  13. week - Allows the user to select a week and year.
Asked by brijesh

Answers (0)

No answers yet. Be the first to answer!