VOOZH about

URL: https://www.geeksforgeeks.org/html/html-input-type/

⇱ HTML Input Type - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

HTML Input Type

Last Updated : 28 Apr, 2025

HTML Input Element has various types that play an important role in creating HTML Forms, and the element is efficient in collecting user data and adding interactivity to web pages. These elements provide the feature to create an interactive web page. In the Input Element, there is an attribute type having different values that help to create the form according to the requirements of the web page. The default value of type is "text" in the input element. The input elements can be customized by applying CSS to them and the elements can also be manipulated dynamically with JavaScript. Below is the list of various Input Types with their basic illustrations.

We will explore each of them with their basic implementations.

Input Type "text"

This type facilitates short, straightforward text input for capturing simple information like names or comments.

Example: The example illustrates the input type text.

Output:

👁 intext
Output

Input Type "password"

This type ensures secure data entry by hiding characters, commonly used for password inputs.

Example: The example illustrates the input type Password.

Output:

👁 intpaswd
Output

Input Type "submit"

This type triggers the submission of form data and allows the transfer of entered data to a server.

Example: The example illustrates the input type submit.

Output:

👁 intsub
Output

Input Type "color"

This type opens a color picker, simplifying the selection of preferred colors for designing of webpage.

Example: The example illustrates the input type Color.

Output:

👁 intcolor

Input Type "date"

This type provides users with an easy-to-use calendar and choose a specific date.

Example: The example illustrates the input type date.

Output:

👁 intdate

Input Type "email"

This type is basically designed for entering email addresses, ensuring the correct email format.

Example: The example illustrates the input type email.

Output:

👁 intemail

Input Type "file"

This type allows users to attach and upload files from their devices.

Example: The example illustrates the input type file.

Output:

👁 filese
OUTPUT

Input Type "hidden"

Operating in the background, this type especially manages and stores data without user visibility.

Example: The example illustrates the input type hidden.

Output:

👁 inputhidden
Output

Input Type "image"

This type acts as a clickable image, sometimes serving as a visual trigger for form submission.

Example: The example illustrates the input type image.

Output:

👁 gfgin
Output

Input Type "url"

This type includes basic validation for entering accurate URLs.

Example: The example illustrates the input type URL.

Output:

👁 url

Input Type "time"

This type facilitates the selection of a specific time, sometimes used in conjunction with date inputs.

Example: The example illustrates the input type time.

Output:

👁 inputtime
OUTPUT

Input Type "number"

This type enables users to input numeric values, with optional constraints for specified ranges.

Example: The example illustrates the input type number.

Output:

👁 inputnum
Output

Input Type "radio"

This type allows users to select one option from a set, making choices in a mutually exclusive manner.

Example: The example illustrates the input type radio.

Output:

👁 intradio

Input Type "range"

With a slider interface, this type simplifies the selection of numeric values within ranges.

Example: The example illustrates the input type range.

Output:

👁 inputrange
OUTPUT

Input Type "reset"

This type is used for Initiating a form rollback, this type basically reverts fields to their default values.

Example: The example illustrates the input type reset.

Output:

👁 intreset

Input Type "search"

It is used for search boxes, this type encourages users to type and initiate search operations.

Example: The example illustrates the input type search.

Output:

👁 inputsearch
output

Input Type "button"

This type serves as a clickable button, often used for custom interactions.

Example: The example illustrates the input type button.

Output:

👁 intbtn1
Output

Input Type "tel"

It is designed for telephone numbers, this type streamlines the input process with numeric keyboards.

Example: The example illustrates the input type tel.

Output:

👁 telin
Output

Input Type "week"

In this users can easily select a specific week within a year using this type.

Example: The example illustrates the input type week.

Output:

👁 inputweek
Output

Input Type "month"

This type facilitates the selection of a specific month and year for date-related inputs.

Example: The example illustrates the input type month.

Output:

👁 inputmonth
Output

Input Type "datetime-local"

It is used to define a date and time control. The value must include the year, month, day, and time.

Example: The example illustrates the input type datetime-local.

Output:

👁 intdatetime
Output

Input Type "checkbox"

This type allows users to toggle between checked and unchecked states for straightforward decision-making.

Example: The example illustrates the input type checkbox.

Output:

👁 intcheck
Output
Comment
Article Tags:
Article Tags: