HTML Input Types

HTML provides a range of input types that can be used with the `` element. Each input type is specified by the `type` attribute. Here are some commonly used input types in HTML:


1. `text`: Creates a single-line text input field.

2. `password`: Creates a text input field for passwords (characters are masked).

3. `email`: Creates a text input field specifically for email addresses. Browsers usually perform email validation.

4. `number`: Creates a text input field for numeric values. Browsers usually provide a numeric keypad for mobile devices.

5. `checkbox`: Creates a checkbox for selecting one or more options.

6. `radio`: Creates a radio button for selecting a single option from a group. Radio buttons within the same `name` attribute form a group.

7. `file`: Creates a file input field for uploading files. Users can select one or multiple files.

8. `date`, `time`, `datetime-local`: Create input fields for selecting date, time, or both (date and time) values. The displayed format may vary across browsers.

9. `url`: Creates a text input field specifically for URLs. Browsers usually perform URL validation.

10. `color`: Creates a color picker input field for selecting a color.

11. `range`: Creates a slider input for selecting a value within a specified range.

12. `search`: Creates a text input field for search queries. Browsers may provide specific functionality for search inputs.

13. `tel`: Creates a text input field specifically for telephone numbers. Browsers may provide specific input modes or validation.

14. `hidden`: Creates a hidden input field that is not visible to the user. It can store data to be processed on the server-side.



These are some of the commonly used input types in HTML. Each input type has its own specific behavior and may be rendered differently by different browsers. It's important to use the appropriate input type that best fits the data you want to collect from users.



About the Author



Silan Software is one of the India's leading provider of offline & online training for Java, Python, AI (Machine Learning, Deep Learning), Data Science, Software Development & many more emerging Technologies.

We provide Academic Training || Industrial Training || Corporate Training || Internship || Java || Python || AI using Python || Data Science etc





 PreviousNext