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.
<input>

Attributes

Δ

<input attribute-name="attribute-value">
 
Specific:
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
 
Common:
Name: Value: Description:
accesskey key label list Key label or list of key labels with which to associate the element; each key label represents a keyboard shortcut which UAs can use to activate the element or give focus to the element
class tokens Name of a classification, or list of names of classifications, to which the element belongs
contenteditable true | false | empty Specifies whether the contents of the element are editable - HTML5
contextmenu IDREF Identifies a menu with which to associate the element as a context menu - HTML5
dir ltr | rtl Specifies the element's text directionality
draggable true | false Specifies whether the element is draggable - HTML5
hidden hidden | empty Specifies that the element represents an element that is not yet, or is no longer, relevant - HTML5
id ID Unique identifier for the element
lang language tag Specifies the primary language for the contents of the element and for any of the element's attributes that contain text
onabort string Handles the event when the download is aborted by the user
onblur string Handles the event losing focus
oncanplay string Handles the event when the user agent can resume playback of the media data, but estimates that if playback were to be started now, the media resource could not be rendered at the current playback rate up to its end without having to stop for further buffering of content
oncanplaythrough string Handles the event when the user agent estimates that if playback were to be started now, the media resource could be rendered at the current playback rate all the way to its end without having to stop for further buffering
onchange string Handles the event when the user commits a value change
onclick string Handles the event when the user clicks the mouse
oncontextmenu string Handles the event when the user requests their context menu
ondblclick string Handles the event when the user double-clicks the mouse
ondrag string Handles the event when the drag is in progress
ondragend string Handles the event when the drag is completed
ondragenter string Handles the event when the drag object enters an area
ondragleave string Handles the event when the drag object leaves an area
ondragover string Handles the event when the drag object is over an area
ondragstart string Handles the event when the drag is initiated
ondrop string Handles the event when the drag object is released
ondurationchange string Handles the event when the duration attribute has just been updated
onemptied string Handles the event when a media element whose networkState was previously not in the NETWORK_EMPTY state has just switched to that state (either because of a fatal error during load that's about to be reported, or because the load() method was invoked while the resource selection algorithm was already running)
onended string Handles the event when playback has stopped because the end of the media resource was reached
onerror string Handles the event when network and script errors occur
onfocus string Handles the event gaining focus
onformchange string Handles the event when the user commits a value change to a control on the form
onforminput string Handles the event when the user changes the value of a control on the form
oninput string Handles the event when the user changes the value
oninvalid string Handles the event during form validation if they do not satisfy their constraints
onkeydown string Handles the event when the key is down
onkeypress string Handles the event when the key is pressed
onkeyup string Handles the event when the key is up
onload string Handles the event when the document has finished loading; fired at an element containing a resource (e.g. img, embed) when its resource has finished loading
onloadeddata string Handles the event when the user agent can render the media data at the current playback position for the first time
onloadedmetadata string Handles the event when the user agent has just determined the duration and dimensions of the media resource
onloadstart string Handles the event when the user agent begins looking for media data, as part of the resource selection algorithm
onmousedown string Handles the event when the user presses the mouse button
onmousemove string Handles the event when the user moves the mouse
onmouseout string Handles the event when user moves the mouse icon outside the object
onmouseover string Handles the event when the user moves the mouse icon over the object
onmouseup string Handles the event when the user releases the mouse button
onmousewheel string Handles the event when the user moves the mouse wheel
onpause string Handles the event when playback has been paused. Fired after the pause method has returned
onplay string Handles the event when playback has begun. Fired after the play() method has returned
onplaying string Handles the event when playback has started
onprogress string Handles the event when the user agent is fetching media data
onratechange string Handles the event when either the defaultPlaybackRate or the playbackRate attribute has just been updated
onreadystatechange string Handles the event when it finishes parsing and again when all its subresources have finished loading
onscroll string Handles the event when it is scrolled
onseeked string Handles the event when the seeking IDL attribute changed to false
onseeking string Handles the event when the seeking IDL attribute changed to true and the seek operation is taking long enough that the user agent has time to fire the event
onselect string Handles the event when it is selected
onshow string Handles the event when it is shown as a context menu
onstalled string Handles the event when the user agent is trying to fetch media data, but data is unexpectedly not forthcoming
onsubmit string Handles the event when it is submitted
onsuspend string Handles the event when the user agent is intentionally not currently fetching media data, but does not have the entire media resource downloaded
ontimeupdate string Handles the event when the current playback position changed as part of normal playback or in an especially interesting way, for example discontinuously
onvolumechange string Handles the event when either the volume attribute or the muted attribute has changed. Fired after the relevant attribute's setter has returned
onwaiting string Handles the event when playback has stopped because the next frame is not available, but the user agent expects that frame to become available in due course
spellcheck true | false | empty Specifies whether the element represents an element whose contents are subject to spell checking and grammar checking - HTML5
style string Specifies zero or more CSS declarations that apply to the element
tabindex integer Specifies whether the element represents an element that is is focusable (that is, an element which is part of the sequence of focusable elements in the document), and the relative order of the element in the sequence of focusable elements in the document
title normal character data Advisory information associated with the element

Example | Attributes | accept

Δ

Example | Attributes | alt

Δ

Example | Attributes | autocomplete

Δ

Example | Attributes | autofocus

Δ

Example | Attributes | checked

Δ

Example | Attributes | disabled

Δ

Example | Attributes | form

Δ

Example | Attributes | formaction

Δ

Example | Attributes | formenctype

Δ

Example | Attributes | formmethod

Δ

Example | Attributes | formnovalidate

Δ

Example | Attributes | formtarget

Δ

Example | Attributes | height

Δ

Example | Attributes | list

Δ

Example | Attributes | max

Δ

Example | Attributes | maxlength

Δ

Example | Attributes | min

Δ

Example | Attributes | multiple

Δ

Example | Attributes | name

Δ

Example | Attributes | pattern

Δ

Example | Attributes | placeholder

Δ

Example | Attributes | readonly

Δ

Example | Attributes | required

Δ

Example | Attributes | size

Δ

Example | Attributes | src

Δ

Example | Attributes | step

Δ

Example | Attributes | type

Δ

Example | Attributes | value

Δ

Example | Attributes | width

Δ

Example | CSS

Δ

References

Δ