HTML input tag

Last Updated on April 26, 2023 by Roshan Parihar

HTML input tag is used to get user input data to communicate with a website.

This tag comes in forms, which on submit, some action will perform to send the data. The HTML input control is of various types depending upon the kind of the entry field.


Syntax

Output






List of HTML input tag type attribute options

Sr. No. type attribute options Description
1 text This used to display one line input text.
2 password used to show password input text
3 email This is used to show input text which takes only email id as a valid value
4 radio This is used to show multiple radio buttons options for selection.
5 checkbox This is used to show multiple checkbox options for single selection as well as multiple selections.
6 submit This shows submit button used for submitting the form.
7 file This is used to browse and take input as a file for attachment and uploading.
8 reset This is used to reset form data to default values .

This example is a password input field which takes the password as a contribution. The information entered in this area is not visible to the users.

Output




This example is email input field to get only email id as a valid value. The user must enter an email id as a valid value, otherwise it will not accept the given input.

Output




The radio buttons with multiple options which we can use in the form for user selection.

Output

Male
Female
Others

Input type checkboxes with multiple options which we can use inside the form for user selection.

Output

Male
Female
Others

The submit button inside forms for submission after entering the values of various inputs and options.

Output





The reset button inside the form for resetting the entered values to default.

Output





Resources and References

1. W3C Specification.
2. HTML living standard
3. W3C project using Github