Skip to main content
Albero Academy

Input Types

The many input types for different data.

Forms8 min

The <input> element's type attribute changes what it collects and how it behaves — the right type gives the right keyboard on mobile and built-in validation for free.

Common input types

typeFor
textGeneral short text
email / url / telValidated formats + mobile keyboards
passwordMasked input
number / rangeNumeric entry / slider
date / timeA date/time picker
checkbox / radioMultiple / single choice
fileFile upload
color / search / hiddenSpecialised inputs

Key takeaways

  1. 01The type attribute sets what an <input> collects and how it behaves.
  2. 02Types include text, email, password, number, date, checkbox, radio, file and more.
  3. 03The right type gives format validation and the correct mobile keyboard for free.
  4. 04Use the most specific type for better UX.

Finished this chapter?

Mark it complete to track your progress through HTML.