Input elements in html

what are the input types?

·

2 min read

The input type elements specify an input field where you can enter the data. the input element is the most important form element. This input element can be displayed in many ways, depending on the type attribute.

The different input types are as follows:

<input type="button">

when we use this input type, a button will be formed. we can also give a name to these buttons.

<input type="checkbox">

This gives a checkbox.

<input type="color">

with the help of this input type, one can easily apply a color.

<input type="date">

this type creates input fields that should contain a date.

<input type="DateTime-local">

this specifies a date and time input field, with no time zone.

<input type="email">

this input type email is used for input fields that should contain an e-mail address.

<input type="image">

defines an image as a submit button. the path for the image is specified in src attribute

<input type="hidden">

this type defines a hidden input field (not visible to a user).

<input type="file">

it defines a file-select field and a "Browse" button for file uploads.

<input type="month">

it allows you to select a month and year. a date picker can show up in the input field.

<input type="number">

defines a numeric input field.

<input type="password">

defines a password field.

<input type="radio">

it defines a radio button.

<input type="range">

defines a control for entering a number whose exact value is not important (like a slider control).

<input type="reset">

defines a reset button that will reset all form values to their default values.

<input type="search">

this input type is used for search fields.

<input type="submit">

this input type gives a button for submitting any type of form.

<input type="tel">

this input field will contain a telephone number.

<input type="text"> (default value)

it defines a single-line text input field*.*

<input type="time">

this allows the user to select a time.

<input type="URL">

it is used for an input field that should contain a URL address.

<input type="week">

this input type is used for input fields that should contain a URL address.