Commonly Used Input Types in HTML Forms
|
|
|
|
Input Type |
|
|
|
|
|
|
|
|
<input type=”text”> |
Defines a one-line text input field |
|
|
|
|
<input type=”password”> |
Defines a password field |
|
|
|
|
<input type=”submit”> |
Defines a submit button |
|
|
|
|
<input type=”reset”> |
Defines a reset button |
|
|
|
|
<input type=”radio”> |
Defines a radio button |
|
|
|
|
<input type=”email”> |
Validates that the input is a valid email address. |
|
|
|
|
<input type=”number”> |
Allows the user to enter a number. You can specify min, max, and step attributes for range. |
|
|
|
|
<input type=”checkbox”> |
Used for checkboxes where the user can select multiple options. |
|
|
|
|
Input Type |
|
|
|
|
|
|
|
|
<input type=”date”> |
Allows the user to select a date from a calendar. |
|
|
|
|
<input type=”time”> |
Allows the user to select a time. |
|
|
|
|
<input type=”file”> |
Allows the user to select a file to upload. |