The <input> tag defines an input field as a parameter to a <form>.

An input field can vary in many ways, depending on the type attribute.


Attribute Type Description
accept media_type Specifies the types of files that the server accepts (only for type=’file’)
autocomplete autocomplete types Specifies the autocomplete hint
checked checked Specifies that an <input> element should be pre-selected when the document loads (for type=’checkbox’ or type=’radio’)
disabled disabled Specifies that an <input> element should be disabled
max number or date Specifies the maximum value for an <input> element
maxlength number Specifies the maximum number of characters allowed in an <input> element
min number or date Specifies a minimum value for an <input> element
multiple multiple Specifies that a user can enter more than one value in an <input> element
name text Specifies the name of an <input> element
pattern regexp Specifies a regular expression that an <input> element’s value is checked against
placeholder text Specifies a short hint that describes the expected value of an <input> element
readonly readonly Specifies that an input field is read-only
required required Specifies that an input field must be filled out before submitting the form
step number Specifies the legal number intervals for an input field
type checkbox, color, date, datetime-local, email, file, hidden, month, number, radio, range, tel, text, time, url or week Specifies the type <input> element to use
value text Specifies the value of an <input> element