logo Learn HTML
  • Home
  • Tutorials
  • Practice
  • Quiz
  • Projects
  • About
  • Contact

HTML Course

  • HTML HOME
  • HTML Introduction
  • HTML Basic
  • HTML Element
  • HTML Attributes
  • HTML Headings
  • HTML Paragrapha
  • HTML Style
  • HTML Formattin
  • HTML Quotations
  • HTML Colors
  • HTML Css
  • HTML Links
  • HTML Image
  • HTML Favicon
  • Page Tittle
  • HTML Tables
  • HTML Lists
  • Block & Inline
  • HTML Div
  • HTML Classes
  • HTML Id
  • HTML Buttons
  • HTML Iframes
  • HTML File Paths
  • HTML Head
  • HTML Layout
  • HTML Symbols
  • HTML Emojis
  • HTML URL Encode
  • HTML VS XHTML
  • HTML FROM
  • HTML Form
  • Form Attributes
  • Form Elements
  • HTML Input Types
  • HTML Input Attributes
  • Input Form Attributes
  • HTML Graphics
  • HTML Canvas
  • HTML SVG
  • HTML Media
  • HTML Media
  • HTML Video
  • HTML Audio
  • HTML Plug-ins
  • HTML Youtube
  • HTML APIS
  • HTML Web APIS
  • HTML Geolocation
  • HTML Drag & Drop
  • Web Storage
  • Web Workers
  • HTML SSE
  • HTML Examples
  • HTML Examples
  • HTML Editor
  • HTML Quiz
  • HTML Exercises
  • HTML References
  • HTML Tag List
  • HTML Attributes
  • HTML Global Attributes
  • HTML Brower Support
  • HTML Events
  • HTML Colors
  • HTML Canvas
  • HTML Audio & Video
  • HTML Doctypes
  • HTML Character Sets
  • HTML URL Encode
  • Language Codes
  • HTTP Messages
  • HTTP Methods
  • PX to EM Converter
  • keyboard Shortcuts

HTML Input Types


The <input> element is used to collect user data in different ways.

The behavior of <input> depends on its type attribute.

If no type is specified, the default type is text.


Common Input Types


1. Text

Creates a single-line text field.

<input type="text" name="username">

Used for names, titles, short messages, etc.


2. Password

Hides the characters while typing.

<input type="Password" name="Password">

Used for login passwords


3. Email

Accepts email address

Browsers may automatically validate the format.

<input type="email" name="email">

4. Number

Accepts numeric values only.

<input type="Number" name="quantity" min="1" max="10">

You can use

  • min minimum value
  • max maximum value
  • step number interval

5. Date

Allows the user to select a date.

<input type="date" name="birthday">

6. Time

Allows the user to select a time.

<input type="time" name="appointment">

7. Datetime-local

Selects both date and time (no timezone).

<input type="datetime-local" name="event">

8. Month

Selects month and year.

<input type="month" name="month">

9. week

Selects week and year.

<input type="week" name="week">

10. color

Opens a color picker.

<input type="color" name="favcolor">

11. File

Allows users to upload files.

<input type="file" name="myfile">

12. Hidden

Not visible to users.

<input type="hidden" name="userid" value="123">

Note: Hidden fields are not secure


13. Radio

Allows selecting only one option.

<input type="radio" name="gender" value="male">

14. Checkbox

Allows selecting multiple options.

<input type="checkbox" name="vehicle" value="bike">


15. Range

Creates a slider control.

<input type="range" name="volume" min="0" max="100" >

16. Search

Used for search boxes

< input type="search" name="search" >

17. Tel

Used for telephone numbers.

< Used for telephone numbers. >

18. URL

Accepts website addresses

< input type="url" name="website" >

19. Submit

Submits the form data

< input type="url" name="website" >

19. Submit

Submits the form data

< input type="submit" value="Submit" >

20. Reset

Resets form values to default."

< input type="reset" value="Reset" >

Try It Your Self

Sign Up For New
Update

HTML Basic
  1. HTML Basic
  2. HTML Element
  3. HTML Attributes
  4. HTML Headings
  5. HTML Paragrapha
  6. HTML Tables
  7. HTML Lists
HTML Advance
  1. HTML Div
  2. HTML Classes
  3. HTML Id
  4. HTML Buttons
  5. HTML Iframes
  6. HTML Symbols
  7. HTML Emojis