HTML Input Types
Learn different HTML input types and how they are used to collect various kinds of user data.
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 textemail→ email addresspassword→ hidden textnumber→ numeric inputcheckbox→ multiple choiceradio→ single choicesubmit→ form submission
Important Notes
- Choose correct input type
- Improves validation and UX
- Some types add built-in validation
Was this helpful?
Thanks for your feedback!