Input Tag in HTML?
- Input tag specifies an input field where the user can enter data.
- <input> tag is used to create input fields.
- Input tags don't need any closing tags.
Input Tag Types
i). Text: It is used to create a text input field.
ii). Color: It is used for input fields that contain color. And it creates a color picker.
iii). DateTime: It specifies an input field that contains the date and time.
iv). DateTime Local: It specifies the date and time input with no time zone.
v). Email: It is used for the input field which contains e-mail address.
vi). File: It is used for the input field which takes a file as input form the user.
vii). Image: It is used to define an image as a submit button.
viii). Number: It is used to define an input field which contains a numeric value.
ix). Password: It is used to create an input field which contains input data as password.
x). Phone: It defines an input field which contains telephone number.
xi). Range: It is used to define a control for entering a numeric value. The default range is from 0 to 100.
xii). Radio: It is used to create radio button.
xiii). Time: It is used to create an input field which allows the user to select a time.
xiv). Reset: It is used to create a reset button.
xv). URL: It is used for input fields that contain a URL address.
xvi). Week: It is used to create an input field which allows the user to select a week and year.
xvii). Checkbox: It is used to create a checkbox.
xviii). Button: It is used to define a button.
Input Tag Attributes in HTML
- Attributes are used to provide additional information of an HTML tag.
Input Tag Attributes
i). name: This attribute is used to specify the name of the element.
ii). placeholder: It represents, what type of value you can insert in the input field.
iii). disabled: It is used to disable the input field from the user side.
iv). value: This attribute is used to set the initial value to the input field.
v). readonly: This attribute is used to make readonly input field.
vi). required: This specifies that the input field must be filled.
vi). min-max: These are used to set the min and max values.
Code Described in the video