INPUT
The input element represents a typed data field, usually with a form control to allow the user to edit the data.
SYNTAX
HTML
<input attribute-name="attribute-value"></input>
ATTRIBUTES
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) |
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 |
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 |
formaction | URI | Form-submission action for the element |
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 |
formmethod | get | post | put | delete | HTTP method with which a UA is meant to associate this element for form submission |
formnovalidate | formnovalidate | empty | Specifies that the element represents a control whose value is not meant to be validated during form submission |
formtarget | browsing-context name or keyword | Browsing context or keyword that represents the target of the control |
height | non-negative integer | Vertical dimension |
list | IDREF | Identifies a datalist with which to associate the element |
max | date-time | local date-time | date | month | time | week | float | Expected upper bound for the element's value |
maxlength | positive integer | Maximum length of value |
min | date-time | local date-time | date | month | time | week | float | Expected lower bound for the element's value |
multiple | multiple | empty | Specifies that the element allows multiple values |
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 |
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 |
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 |
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 |
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 | Horizontal dimension |
TYPES
NAME | DESCRIPTION |
---|---|
button | represents a button with no additional semantics, |
checkbox | represents a state or option that can be toggled, |
color | represents a color-well control, for setting the element's value to a string representing a simple color. |
date | represents a control for setting the element's value to a string representing a date, |
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), |
represents a control for editing a list of e-mail addresses given in the element's value, | |
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, |
month | represents a control for setting the element's value to a string representing a month, |
number | represents a precise control for setting the element's value to a string representing a number, |
password | represents a one-line plain-text edit control for entering a password, |
radio | represents a selection of one item from a list of items (a radio button), |
range | represents an imprecise control for setting the element's value to a string representing a number, |
reset | represents a button for resetting a form, |
search | represents a one-line plain-text edit control for entering one or more search terms, |
submit | represents a button for submitting a form, |
tel | represents a one-line plain-text edit control for entering a telephone number, and |
text | represents a one-line plain text edit control for the input element's value, |
time | represents a control for setting the element's value to a string representing a time (with no timezone information), |
url | represents a control for editing an absolute URL given in the element's value, |
week | represents a control for setting the element's value to a string representing a week, |