Advertisement

Google Ad Slot: content-top

Inputs

~1 min read · HTML
On this page

In HTML, multiple types of inputs can be used in forms to capture different kinds of user data. Here are the most common input types:


Basic Inputs

Input types

Description

Text

Text (type="text"): Single-line text input.

Password

Password (type="password"): Hides the entered text.

Email

Email (type="email"): Ensures email format validation.

Select

Select (dropdown) for selecting options

Textarea

Textarea for multi-line text input

Radio

Radio (type="radio"): Single-choice selection from a group.

Checkbox

Checkbox (type="checkbox"): For multiple-choice selections.

Number

Number (type="number"): For numeric input, with min and max attributes.

Range

Range (type="range"): Input for numeric values via a slider.

Submit

Submit (type="submit"): A button that submits the form data.

Reset

Reset (type="reset"): A button that resets the form fields to their default values.

File

File (type="file"): Input for file uploads.

Input type text

Text (type="text"): Single-line text input.

Example


Try it yourself

Input type password

Password (type="password"): Hides the entered text.

Example


Try it yourself

Input type email

Email (type="email"): Ensures email format validation.

Example


Try it yourself

Input type select

Select (dropdown) (<select>) for selecting options

Example


Try it yourself

Input type textarea

Textarea (<textarea>) for multi-line text input

Example


Try it yourself

Input type radio

Radio (type="radio"): Single-choice selection from a group.

Example


Try it yourself

Input type checkbox

Checkbox (type="checkbox"): For multiple-choice selections.

Example


Try it yourself

Input type number

Number (type="number"): For numeric input, with min and max attributes.

Example


Try it yourself

Input type range

Range (type="range"): Input for numeric values via a slider.

Example


Try it yourself

Input type submit

Submit (type="submit"): A button that submits the form data.

Example
Try it yourself

Input type reset

Reset (type="reset"): A button that resets the form fields to their default values.

Example
Try it yourself

Advanced Inputs

Input types
Description
Tel
Tel (type="tel"): Input for phone numbers (no built-in validation).
Color
Color (type="color"): Input for selecting a color.
Search
Search (type="search"): Input for search queries.
URL
URL (type="url"): Input for URLs.
Hidden
Hidden (type="hidden"): Hidden input field for including data in form submissions without showing it to the user.
Image
Image (type="image"): A submit button that includes an image.
Date
Date (type="date"): Input for selecting a date.
Month
Month (type="month"): Input for selecting a month and year.
Week
Week (type="week"): Input for selecting a week.
Time
Time (type="time"): Input for selecting time.
Datetime-local
Datetime-local (type="datetime-local"): Input for selecting both date and time.

Input type tel

Tel (type="tel"): Input for phone numbers (no built-in validation).

Example


Try it yourself

Input type color

Color (type="color"): Input for selecting a color.

Example


Try it yourself

Input type date

Date (type="date"): Input for selecting a date.

Example


Try it yourself

Input type month

Month (type="month"): Input for selecting a month and year.

Example


Try it yourself

Input type week

Week (type="week"): Input for selecting a week.

Example


Try it yourself

Input type time

Time (type="time"): Input for selecting time.

Example



Input type datetime

Datetime-local (type="datetime-local"): Input for selecting both date and time.

Example


Try it yourself

Input type image

Image (type="image"): A submit button that includes an image.

Example


Try it yourself

Input type Search  

Search (type="search"): Input for search queries.

Example


Try it yourself

Input type url

URL (type="url"): Input for URLs.

Example


Try it yourself

Input type hidden

Hidden (type="hidden"): Hidden input field for including data in form submissions without showing it to the user.

Example


Try it yourself

All inputs Example










































Try it yourself