HTML5 Input Types
HTML
HTML5 introduced many new input types that make forms more powerful and user-friendly.
These types help browsers show appropriate keyboards on mobile, validate data, and give better UI.
Common HTML5 Input Types
1. type="text"
Basic single-line text input.
2️. type="email"
Validates input to be a valid email format.
3️. type="number"
Allows only numbers, with optional min
and max
.
4️. type="tel"
Used for phone numbers. On mobile, shows number keypad.
5️. type="url"
Validates for proper URL format.
6️. type="password"
Hides the characters entered.
7️. type="date"
Shows a date picker.
8️. type="time"
Selects time.
9️. type="range"
Creates a slider.
1️0. type="color"
Color picker.
1️1️. type="search"
Styled for search input.
1️2️. type="checkbox"
Multiple selections.
1️3️. type="radio"
Single selection among options.
1️4️. type="file"
For uploading files.