HTML Input Types

The type attribute defines what kind of input field is shown.


Common Input Types

<input type="text" name="username">
<input type="email" name="email">
<input type="password" name="password">
<input type="number" name="age">
<input type="checkbox" name="agree">
<input type="radio" name="gender">
<input type="submit" value="Submit">

Input Types Explained

  • text → single-line text
  • email → email address
  • password → hidden text
  • number → numeric input
  • checkbox → multiple choice
  • radio → single choice
  • submit → form submission

Important Notes

  • Choose correct input type
  • Improves validation and UX
  • Some types add built-in validation