input

The input element with a type attribute whose value is:

text represents a one-line plain text edit control for the input element's value,
password represents a one-line plain-text edit control for entering a password,
checkbox represents a state or option that can be toggled,
radio represents a selection of one item from a list of items (a radio button),
button represents a button with no additional semantics,
submit represents a button for submitting a form,
reset represents a button for resetting a form,
file represents a list of file items, each consisting of a file name, a file type, and a file body (the contents of the file),
hidden represents a value that is not intended to be examined or manipulated by the user,
image represents either an image from which the UA enables a user to interactively select a pair of coordinates and submit the form, or alternatively a button from which the user can submit the form,
HTML5
datetime represents a control for setting the element's value to a string representing a global date and time (with timezone information),
datetime-local represents a control for setting the element's value to a string representing a local date and time (with no timezone information),
date represents a control for setting the element's value to a string representing a date,
month represents a control for setting the element's value to a string representing a month,
time represents a control for setting the element's value to a string representing a time (with no timezone information),
week represents a control for setting the element's value to a string representing a week,
number represents a precise control for setting the element's value to a string representing a number,
range represents an imprecise control for setting the element's value to a string representing a number,
email represents a control for editing a list of e-mail addresses given in the element's value,
url represents a control for editing an absolute URL given in the element's value,
search represents a one-line plain-text edit control for entering one or more search terms,
tel represents a one-line plain-text edit control for entering a telephone number, and
color represents a color-well control, for setting the element's value to a string representing a simple color.

Attributes

<input attribute-name="attribute-value">
Name Value Description
accept mime-type list Provides the UA with a hint of what file types the server is able to accept
alt normal character data Fallback content for the image map
autocomplete on | off Specifies whether the element represents an input control for which a UA is meant to store the value entered by the user (so that the UA can prefill the form later) - HTML5
autofocus autofocus | empty Specifies that the element represents a control to which a UA is meant to give focus as soon as the document is loaded - HTML5
checked checked | empty Specifies that the element represents a selected control
disabled disabled | empty Specifies that the element represents a disabled control
form IDREF Identifies a form with which to associate the element - HTML5
formaction URI Form-submission action for the element - HTML5
formenctype application/x-www-form-urlencoded | multipart/form-data | text/plain MIME type with which a UA is meant to associate this element for form submission - HTML5
formmethod get | post | put | delete HTTP method with which a UA is meant to associate this element for form submission - HTML5
formnovalidate formnovalidate | empty Specifies that the element represents a control whose value is not meant to be validated during form submission - HTML5
formtarget browsing-context name or keyword Browsing context or keyword that represents the target of the control - HTML5
height non-negative integer Height of the canvas in CSS pixels
list IDREF Identifies a datalist with which to associate the element - HTML5
max date-time | local date-time | date | month | time | week | float Expected upper bound for the element's value - HTML5
maxlength positive integer Maximum allowed value length of the element
min date-time | local date-time | date | month | time | week | float Expected lower bound for the element's value - HTML5
multiple multiple | empty Specifies that the element allows multiple values - HTML5
name string Name part of the name/value pair associated with this element for the purposes of form submission
pattern pattern Specifies a regular expression against which a UA is meant to check the value of the control represented by its element - HTML5
placeholder string Short hint (one word or a short phrase) intended to aid the user when entering data into the control represented by its element - HTML5
readonly readonly | empty Specifies that element represents a control whose value is not meant to be edited
required required | empty Specifies that the element is a required part of form submission - HTML5
size positive integer Number of options meant to be shown by the control represented by its element
src URI URL for the audio stream
step any | positive float | positive integer Specifies the value granularity of the element's value - HTML5
type button | checkbox | color | date | datetime | datetime-local | email | file | hidden | image | month | number | password | radio | range | reset | search | submit | tel | text | time | url | week Specifies that its input element is a one-line plain-text edit control for the input element's value
value string Specifies a value for this input element
width non-negative integer Width of the canvas in CSS pixels

Global

Example | accept

Example | alt

Example | autocomplete

Example | autofocus

Example | checked

Example | disabled

Example | form

Example | formaction

Example | formenctype

Example | formmethod

Example | formnovalidate

Example | formtarget

Example | height

Example | list

Example | max

Example | maxlength

Example | min

Example | multiple

Example | name

Example | pattern

Example | placeholder

Example | readonly

Example | required

Example | size

Example | src

Example | step

Example | type

Example | value

Example | width

Example | CSS

External

W3C HTML 4.01 Specification

W3C HTML5

W3C HTML 5.1