Advertisement
Google Ad Slot: content-top
Inputs
In HTML, multiple types of inputs can be used in forms to capture different kinds of user data. Here are the most common input types:
Basic Inputs
Input types |
Description |
|---|---|
Text |
Text (type="text"): Single-line text input. |
Password |
Password (type="password"): Hides the entered text. |
Email (type="email"): Ensures email format validation. |
|
Select |
Select (dropdown) for selecting options |
Textarea |
Textarea for multi-line text input |
Radio |
Radio (type="radio"): Single-choice selection from a group. |
Checkbox |
Checkbox (type="checkbox"): For multiple-choice selections. |
Number |
Number (type="number"): For numeric input, with min and max attributes. |
Range |
Range (type="range"): Input for numeric values via a slider. |
Submit |
Submit (type="submit"): A button that submits the form data. |
Reset |
Reset (type="reset"): A button that resets the form fields to their default values. |
File |
File (type="file"): Input for file uploads. |
Input type text
Text (type="text"): Single-line text input.
Input type password
Password (type="password"): Hides the entered text.
Input type email
Email (type="email"): Ensures email format validation.
Input type select
Select (dropdown) (<select>) for selecting options
Input type textarea
Textarea (<textarea>) for multi-line text input
Input type radio
Radio (type="radio"): Single-choice selection from a group.
Input type checkbox
Checkbox (type="checkbox"): For multiple-choice selections.
Input type number
Number (type="number"): For numeric input, with min and max attributes.
Input type range
Range (type="range"): Input for numeric values via a slider.
Input type submit
Submit (type="submit"): A button that submits the form data.
Input type reset
Reset (type="reset"): A button that resets the form fields to their default values.
Advanced Inputs
| Input types | Description |
|---|---|
| Tel | Tel (type="tel"): Input for phone numbers (no built-in validation). |
| Color | Color (type="color"): Input for selecting a color. |
| Search | Search (type="search"): Input for search queries. |
| URL | URL (type="url"): Input for URLs. |
| Hidden | Hidden (type="hidden"): Hidden input field for including data in form submissions without showing it to the user. |
| Image | Image (type="image"): A submit button that includes an image. |
| Date | Date (type="date"): Input for selecting a date. |
| Month | Month (type="month"): Input for selecting a month and year. |
| Week | Week (type="week"): Input for selecting a week. |
| Time | Time (type="time"): Input for selecting time. |
| Datetime-local | Datetime-local (type="datetime-local"): Input for selecting both date and time. |
Input type tel
Tel (type="tel"): Input for phone numbers (no built-in validation).
Input type color
Color (type="color"): Input for selecting a color.
Input type date
Date (type="date"): Input for selecting a date.
Input type month
Month (type="month"): Input for selecting a month and year.
Input type week
Week (type="week"): Input for selecting a week.
Input type time
Time (type="time"): Input for selecting time.
Input type datetime
Datetime-local (type="datetime-local"): Input for selecting both date and time.
Input type image
Image (type="image"): A submit button that includes an image.
Input type Search
Search (type="search"): Input for search queries.
Input type url
URL (type="url"): Input for URLs.
Input type hidden
Hidden (type="hidden"): Hidden input field for including data in form submissions without showing it to the user.