Input tag
A cheatsheet by @rstacruz|Refreshed 7 months ago.Refresh|View source on Github

Input

Input

 <input ...
   disabled
   required
   checked
   autofocus
   autocomplete='off'        <!-- autocomplete -->
   autocompletetype='cc-exp'
   autocapitalize='off'      <!-- for mobiles -->
   pattern='\d*'             <!-- force numeric input in iOS -->

Input types

Input types

Text

  • email
  • hidden
  • password
  • tel
  • text
  • search

Time

  • date
  • time

Time (not widely supported)

  • month
  • week
  • datetime
  • datetime-local

Etc

  • file
  • radio
  • checkbox

Buttons

  • button
  • reset
  • submit
  • image

Numeric

  • number
  • range

Dates

Dates

Type Example
type='date'
type='time'

Datetime

Datetime

Type Example
type='datetime'
type='datetime-local'

datetime and datetime-local fields are not widely supported.

Numbers

Numbers

Type Example
type='number'
type='range'

Text

Text

Type Example
type='text'
type='password'
type='search'
type='tel'