--- title: slug: Web/HTML/Element/Input tags: - Element - Formulare - HTML - HTML Formulare - HTML input tag - NeedsMobileBrowserCompatibility - Referenz - Web translation_of: Web/HTML/Element/input ---
{{draft}}{{HTMLRef}}

Das HTML-Element <input> ermöglicht es, interaktive Bedienelemente für webbasierte Formulare zu erstellen, die Daten vom Benutzer entgegennehmen.
Eine große Bandbreite verschiedener Eingabedaten und Bedienelemente ist verfügbar, abhängig je nach Gerät und {{Glossary("user agent")}}. Das <input> Element ist eine der mächtigsten und komplexesten von allen HTML-Elemente, da es eine ungeheure Anzahl an Kombinationen aus Eingabetypen und Attributen besitzt.

Beispiel

Um einen Eindruck davon zu bekommen, wie die unterschiedlichen Typen des <input>-Elements aussehen, kannst du die Werte des Attributs type im folgenden editierbaren Live-Beispiel ändern. Die Ausgabe verändert sich, während du tippst. In jedem Fall erzeugt der Anfangswert text eine einfache Textausgabe. Du kannst andere Werte ausprobieren, etwa number, color, checkbox, radio, date, file, month, password, range oder time.

{{EmbedGHLiveSample("learning-area/html/forms/editable-input-example/editable_input.html", '100%', 230)}}

Content categories Flow content, listed, submittable, resettable, form-associated element, phrasing content.
Wenn der {{htmlattrxref("type", "input")}} nicht den Wert hidden hat, dann ein label-bares Element, mit greifbarem Inhalt.
Permitted content Keiner, das ist ein leeres Element.
Tag omission Muss ein Start-Tag und darf kein End-Tag haben
Erlaubte Elternknoten Jedes Element, das phrasing content erlaubt.
Permitted ARIA roles
  • type=button: {{ARIARole("link")}}, {{ARIARole("menuitem")}}, {{ARIARole("menuitemcheckbox")}}, {{ARIARole("menuitemradio")}}, {{ARIARole("radio")}}, {{ARIARole("switch")}}, {{ARIARole("tab")}}
  • type=checkbox: {{ARIARole("button")}}, {{ARIARole("menuitemcheckbox")}}, {{ARIARole("option")}}, {{ARIARole("switch")}}
  • type=image: {{ARIARole("link")}}, {{ARIARole("menuitem")}}, {{ARIARole("menuitemcheckbox")}}, {{ARIARole("menuitemradio")}}, {{ARIARole("radio")}}, {{ARIARole("switch")}}
  • type=radio: {{ARIARole("menuitemradio")}}
  • type=color|date|datetime|datetime-local|email|file: None
  • type=hidden|month|number|password|range|research: None
  • type=search|submit|tel|text|url|week: None
DOM interface {{domxref("HTMLInputElement")}}

Arten des <input>-Elements

Wie ein <input> sich verhält ist stark von seinem type-Attribut abhängig. Deshalb werden dessen Werte in einer eigenen Referenz beschrieben. Fehlt das Attribut, gilt der Standardwert text.

type kann folgende Werte annehmen:

Einige Werte für das type-Attribut sind jetzt überflüssg:

Attribute

Globale <input>-Attribute

Dieser Abschnitt beschreibt die für alle Arten des input-Elements verfügbaren Attribute. Nicht-globale Attribute – und globale, die sich bei unterschiedlichen input-Elementen anders verhalten – werden bei diesen Elementen behandelt.

Bemerkung: Das gilt auch für die globalen HTML-Attribute

{{htmlattrdef("type")}}
Die Art des Bedienelements. Siehe {{anch("Arten des <input>-Elements")}} für die einzelnen Typen. 
{{htmlattrdef("accept")}}
Ist der Wert des type-Attributes file, beschreibt dieses Attribut die Art der Dateien, die der Server akzeptiert. Sonst wird es ignoriert. Der Wert muss eine durch Kommata getrennte Liste eindeutiger Werte sein:
{{htmlattrdef("accesskey")}} {{HTMLVersionInline(4)}} only, {{obsoleteGeneric("inline", "HTML5")}}
Ein einzelnes Zeichen, dass der Benutzer drücken kann, um den Fokus zu diesem Feld zu bewegen. Dieses Attribute ist in HTML5 global.
{{htmlattrdef("mozactionhint")}} {{non-standard_inline}}
Definiert einen "Aktionstipp", der festlegt wie die Eingabetaste auf Geräten mit virtueller Tastatur erscheint. Zulässige Werte sind go, done, next, search und send. Sie werden automatisch der passenden Zeichenkette zugeordnet. Groß-/Kleinschreibung spielt keine Rolle.
{{htmlattrdef("autocapitalize")}} {{non-standard_inline}}
Dieses Attribut ist nicht standardisiert. Chrome und iOS Safari Mobile kontrollieren damit, ob und wie eingegebener Text automatisch in Großbuchstaben gewandelt wird. Die nicht veralteten Werte sind ab IOS 5 verfügbar. Zulässige Werte sind: autocapitalize documentation in der Safari HTML Reference.
{{htmlattrdef("autocomplete")}} {{HTMLVersionInline("5")}}
Dieses Attribute gibt an, ob der Browser den Wert des Eingabeelements automatisch vervollständigen kann. 
Zulässige Werte sind:

Der WHATWG Standard enthält weitere Details zu diesem Thema

Ist autocomplete für ein Eingabeelement nicht angegeben, verwendet der Browser das autocomplete-Attribut des Formular-Eigentümers für dieses Element. Der Formular-Eigentümer ist entweder das form-Element, von dem dieses input-Element abstammt oder das form-Element, dessen id im form-Attribut des Eingabelements angegeben ist. Mehr Informationen dazu bei {{htmlattrxref("autocomplete", "form")}} in {{HTMLElement("form")}}.

Das autocomplete-Attribute kontrolliert auch, ob Firefox (anders als andere Browser) die Atribute disabled und checked eines Eingabeelements zwischen Ladevorgängen der Seite erhält. Diese Funktion ist normalerweise aktiv, es wird durch Setzen von  autocomplete auf off abgeschaltet. Das gilt auch für solche Eingabefelder, für die das autocomplete-Attribut normalerweise wegen des Werts von type nicht wirkt. Siehe {{bug(654072)}}.

Bei den meisten modernen Browsern (einschließlich Firefox 38+, Google Chrome 34+, IE11+) verhindert das Setzen von autocomplete nicht, dass der Passwort-Manager dem Nutzer anbietet, seine Login-Daten zu speichern und gegebenenfalls anschließend automatisch einzutragen. Siehe the autocomplete attribute and login fields.

{{htmlattrdef("autofocus")}} {{HTMLVersionInline("5")}}
Dieses boolesche Attribut gibt an, dass ein Eingabeelement den Fokus bekommt, wenn die Seite lädt, es sei denn, der Nutzer wechselt ihn, etwa durch Tippen in ein anderes Feld. Nur ein Form-Element in einem Dokument darf das autofocus-Attribut besitzen. Es kann nicht gesetzt werden, wenn das type-Attribut hidden ist. Das heißt, man kann den Fokus nicht automatisch auf ein unsichtbares Element setzen.
Bemerkung: Der Einsatz des autofocus-Attributs kann für Nutzer assistiver Technologien (Screenreader etc.) eine Barriere darstellen, da Inhalte der Seite übersprungen werden, ohne erfasst werden zu können. Dies kann damit umgangen werden, indem zusätzlicher beschreibender Text hinzugefügt wird.
{{htmlattrdef("capture")}}

Ist das type-Attribute file, weist das Vorhandensein dieses boolschen Attributs darauf hin, dass das direkte Mitschneiden von Medien per media capture mechanism bevorzugt ist.

{{htmlattrdef("checked")}}
Ist das type-Attribute radio oder checkbox, setzt dieses boolsche Attribut das Element auf vorausgewählt. Sonst wird das Attribut ignoriert.
{{htmlattrdef("disabled")}}
Dieses boolsche Attribut gewährleistet, dass der Nutzer mit dem Eingabeelement nicht interagieren kann. Insbesondere In particular erhalten so abgeschaltete Elemente keine Click-Events. Außerdem wird der Wert eines abgeschalteten Elements beim Übertragen des Formulars nicht übermittelt. Das Attribute wird ignoriert, wenn das type-Attribut den Wert hidden hat.
{{htmlattrdef("form")}} {{HTMLVersionInline("5")}}
Das form-Element, zu dem dieses Eingabeelement gehört (sein "Formulareigentümer"). Der Wert dieses Attributs muss die id eines {{HTMLElement("form")}}-Elements im selben Dokument sein. Fehlt das Attribut, muss das Eingabeelement Abkömmling eines {{HTMLElement("form")}}-Elements sein. Das Attribut ermöglicht es, Eingabeelemente irgendwo in einem Dokument zu platzieren, nicht nur als Abkömmlinge eines form-Elements. Ein Eingabeelement darf nur zu einem Formular gehören.
{{htmlattrdef("formaction")}} {{HTMLVersionInline("5")}}
The URI of a program that processes the information submitted by the input element, if it is a submit button or image. If specified, it overrides the {{htmlattrxref("action","form")}} attribute of the element's form owner.
{{htmlattrdef("formenctype")}} {{HTMLVersionInline("5")}}
If the input element is a submit button or image, this attribute specifies the type of content that is used to submit the form to the server. Possible values are:

If this attribute is specified, it overrides the {{htmlattrxref("enctype","form")}} attribute of the element's form owner.

{{htmlattrdef("formmethod")}} {{HTMLVersionInline("5")}}
If the input element is a submit button or image, this attribute specifies the HTTP method that the browser uses to submit the form. Possible values are:

If specified, this attribute overrides the {{htmlattrxref("method","form")}} attribute of the element's form owner.

{{htmlattrdef("formnovalidate")}} {{HTMLVersionInline("5")}}
If the input element is a submit button or image, this Boolean attribute specifies that the form is not to be validated when it is submitted. If this attribute is specified, it overrides the {{htmlattrxref("novalidate","form")}} attribute of the element's form owner.
{{htmlattrdef("formtarget")}} {{HTMLVersionInline("5")}}
If the input element is a submit button or image, this attribute is a name or keyword indicating where to display the response that is received after submitting the form. This is a name of, or keyword for, a browsing context (for example, tab, window, or inline frame). If this attribute is specified, it overrides the {{htmlattrxref("target", "form")}} attribute of the elements's form owner. The following keywords have special meanings:
{{htmlattrdef("height")}} {{HTMLVersionInline("5")}}
If the value of the type attribute is image, this attribute defines the height of the image displayed for the button.
{{htmlattrdef("inputmode")}} {{HTMLVersionInline("5")}}
A hint to the browser for which keyboard to display. This attribute applies when the value of the type attribute is text, password, email, or url. Possible values are:
{{htmlattrdef("list")}} {{HTMLVersionInline("5")}}
Identifies a list of pre-defined options to suggest to the user. The value must be the id of a {{HTMLElement("datalist")}} element in the same document. The browser displays only options that are valid values for this input element. This attribute is ignored when the type attribute's value is hidden, checkbox, radio, file, or a button type.
{{htmlattrdef("max")}} {{HTMLVersionInline("5")}}
The maximum (numeric or date-time) value for this item, which must not be less than its minimum (min attribute) value.
{{htmlattrdef("maxlength")}}
If the value of the type attribute is text, email, search, password, tel, or url, this attribute specifies the maximum number of characters (in Unicode code points) that the user can enter; for other control types, it is ignored. It can exceed the value of the size attribute. If it is not specified, the user can enter an unlimited number of characters. Specifying a negative number results in the default behavior; that is, the user can enter an unlimited number of characters. The constraint is evaluated only when the value of the attribute has been changed.
{{htmlattrdef("min")}} {{HTMLVersionInline("5")}}
The minimum (numeric or date-time) value for this item, which must not be greater than its maximum (max attribute) value.
{{htmlattrdef("minlength")}} {{HTMLVersionInline("5")}}
If the value of the type attribute is text, email, search, password, tel, or url, this attribute specifies the minimum number of characters (in Unicode code points) that the user can enter; for other control types, it is ignored.
{{htmlattrdef("multiple")}} {{HTMLVersionInline("5")}}
This Boolean attribute indicates whether the user can enter more than one value. This attribute applies when the type attribute is set to email or file; otherwise it is ignored.
{{htmlattrdef("name")}}
The name of the control, which is submitted with the form data.
{{htmlattrdef("pattern")}} {{HTMLVersionInline("5")}}
A regular expression that the control's value is checked against. The pattern must match the entire value, not just some subset. Use the title attribute to describe the pattern to help the user. This attribute applies when the value of the type attribute is text, search, tel, url or email; otherwise it is ignored. The regular expression language is the same as JavaScript's. The pattern is not surrounded by forward slashes.
{{htmlattrdef("placeholder")}} {{HTMLVersionInline("5")}}
A hint to the user of what can be entered in the control . The placeholder text must not contain carriage returns or line-feeds. This attribute applies when the value of the type attribute is text, search, tel, url or email; otherwise it is ignored.
Note: Do not use the placeholder attribute instead of a {{HTMLElement("label")}} element. Their purposes are different: the {{HTMLElement("label")}} attribute describes the role of the form element; that is, it indicates what kind of information is expected, the placeholder attribute is a hint about the format the content should take. There are cases in which the placeholder attribute is never displayed to the user, so the form must be understandable without it.
{{htmlattrdef("readonly")}}
This Boolean attribute indicates that the user cannot modify the value of the control.

{{HTMLVersionInline("5")}} This attribute is ignored if the value of the type attribute is hidden, range, color, checkbox, radio, file, or a button type.

{{htmlattrdef("required")}} {{HTMLVersionInline("5")}}
This attribute specifies that the user must fill in a value before submitting a form. It cannot be used when the type attribute is hidden, image, or a button type (submit, reset, or button). The {{cssxref(":optional")}} and {{cssxref(":required")}} CSS pseudo-classes will be applied to the field as appropriate.
{{htmlattrdef("selectionDirection")}} {{HTMLVersionInline("5")}}
The direction in which selection occurred. This is "forward" if the selection was made from left-to-right in an LTR locale or right-to-left in an RTL locale, or "backward" if the selection was made in the opposite direction. This can be "none" if the selection direction is unknown.
{{htmlattrdef("size")}}
The initial size of the control. This value is in pixels unless the value of the type attribute is text or password, in which case, it is an integer number of characters. Starting in HTML5, this attribute applies only when the type attribute is set to text, search, tel, url, email, or password; otherwise it is ignored. In addition, the size must be greater than zero. If you don't specify a size, a default value of 20 is used.
{{htmlattrdef("spellcheck")}} {{HTMLVersionInline("5")}}
Setting the value of this attribute to true indicates that the element needs to have its spelling and grammar checked. The value default indicates that the element is to act according to a default behavior, possibly based on the parent element's own spellcheck value. The value false indicates that the element should not be checked.
{{htmlattrdef("src")}}
If the value of the type attribute is image, this attribute specifies a URI for the location of an image to display on the graphical submit button; otherwise it is ignored.
{{htmlattrdef("step")}} {{HTMLVersionInline("5")}}
Works with the min and max attributes to limit the increments at which a numeric or date-time value can be set. It can be the string any or a positive floating point number. If this attribute is not set to any, the control accepts only values at multiples of the step value greater than the minimum.
{{htmlattrdef("tabindex")}} element-specific in {{HTMLVersionInline(4)}}, global in {{HTMLVersionInline("5")}}
The position of the element in the tabbing navigation order for the current document.
{{htmlattrdef("usemap")}} {{HTMLVersionInline(4)}} only, {{obsoleteGeneric("inline", "HTML5")}}
The name of a {{HTMLElement("map")}} element to as an image map.
{{htmlattrdef("value")}}
The initial value of the control. This attribute is optional except when the value of the type attribute is radio or checkbox.
Note that when reloading the page, Gecko and IE will ignore the value specified in the HTML source, if the value was changed before the reload.
{{htmlattrdef("width")}} {{HTMLVersionInline("5")}}
If the value of the type attribute is image, this attribute defines the width of the image displayed for the button.
{{htmlattrdef("x-moz-errormessage")}} {{non-standard_inline}}
This Mozilla extension allows you to specify the error message to display when a field doesn't successfully validate.

Notes

File inputs

Note: Starting in {{Gecko("2.0")}}, calling the click() method on an {{HTMLElement("input")}} element of type "file" opens the file picker and lets the user select files. See Using files from web applications for an example and more details.

You can't set the value of a file picker from a script; doing something like the following has no effect:

var e = getElementById("someFileInputElement");
e.value = "foo";

Error messages

If you want Firefox to present a custom error message when a field fails to validate, you can use the x-moz-errormessage attribute to do so:

<input type="email" x-moz-errormessage="Please specify a valid email address.">

Note, however, that this is not standard and will not have an effect on other browsers.

Examples

A simple input box

<!-- A basic input -->
<input type="text" name="input" value="Type here">

A common use-case scenario

<!-- A common form that includes input tags -->
<form action="getform.php" method="get">
    First name: <input type="text" name="first_name" /><br />
     Last name: <input type="text" name="last_name" /><br />
        E-mail: <input type="email" name="user_email" /><br />
<input type="submit" value="Submit" />
</form>

Using mozactionhint on Firefox mobile

You can use the {{htmlattrxref("mozactionhint", "input")}} attribute to specify the text for the label of the enter key on the virtual keyboard when your form is rendered on Firefox mobile. For example, to have a "Next" label, you can do this:

<input type="text" mozactionhint="next" name="sometext" />

The result is:

mozactionhint.png

Specifications

Specification Status Comment
{{SpecName('HTML WHATWG', 'the-input-element.html#the-input-element', '<input>')}} {{Spec2('HTML WHATWG')}}
{{SpecName('HTML5 W3C', 'forms.html#the-input-element', '<input>')}} {{Spec2('HTML5 W3C')}}
{{SpecName('HTML4.01', 'forms.html#h-17.4', '<form>')}} {{Spec2('HTML4.01')}}

Browser compatibility

{{CompatibilityTable}}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 1.0 {{CompatGeckoDesktop("1.7 or earlier")}} 2 or earlier 1.0 1.0
type 1.0 {{CompatGeckoDesktop("1.7 or earlier")}} 2 1.0 1.0
type=button 1.0 {{CompatGeckoDesktop("1.7 or earlier")}} 3 1.0 1.0
type=checkbox 1.0 {{CompatGeckoDesktop("1.7 or earlier")}}
{{CompatGeckoDesktop("1.9.2")}} for indeterminate value
2 1.0 1.0
type=color 21.0

{{CompatGeckoDesktop("29.0")}} (Not for Windows Touch yet)

{{CompatNo}} 11.01 {{CompatNo}}
type=date 5.0 (recognized but no UI) {{CompatNo}}
{{unimplemented_inline("446510")}}
{{CompatNo}} 10.62 {{CompatVersionUnknown}} (recognized but no UI)
type=datetime 5.0 (recognized but no UI) {{CompatNo}}
{{unimplemented_inline("446510")}}
{{CompatNo}} 10.62 {{CompatVersionUnknown}} (recognized but no UI)
type=datetime-local 5.0 (recognized but no UI) {{CompatNo}}
{{unimplemented_inline("446510")}}
{{CompatNo}} 10.62 {{CompatVersionUnknown}} (recognized but no UI)
type=email 5.0 {{CompatGeckoDesktop("2.0")}} 10 10.62 {{CompatUnknown}}
type=file 1.0 {{CompatGeckoDesktop("1.7 or earlier")}} 3.02 1.0 1.0
type=hidden 1.0 {{CompatGeckoDesktop("1.7 or earlier")}} 2 1.0 1.0
type=image 1.0 Gecko 2.0 only sends x and y coordinates when clicked, not longer the name/value of the element 2 1.0 1.0
type=month 5.0 (recognized but no UI) {{CompatNo}}
{{unimplemented_inline("446510")}}
{{CompatNo}} 10.62 {{CompatVersionUnknown}} (recognized but no UI)
type=number 6.0 (Localization in Chrome 11) {{CompatGeckoDesktop("29.0")}} 10
(recognized but no UI)
10.62 {{CompatVersionUnknown}}
type=password 1.0 {{CompatGeckoDesktop("1.7 or earlier")}} 2 1.0 1.0
type=radio 1.0 {{CompatGeckoDesktop("1.7 or earlier")}}
{{CompatGeckoDesktop("1.9.2")}} for indeterminate value
2 1.0 1.0
type=range 5.0 {{CompatGeckoDesktop("23.0")}} 10 10.62 (11.01 added support for a default value) {{CompatVersionUnknown}}
type=reset 1.0 {{CompatGeckoDesktop("1.7 or earlier")}} 2 1.0 1.0
type=search 5.0 {{CompatGeckoDesktop("2.0")}} 10 11.01 {{CompatVersionUnknown}}
type=submit 1.0 {{CompatGeckoDesktop("1.7 or earlier")}} 2 1.0 1.0
type=tel 5.0 {{CompatGeckoDesktop("2.0")}} 10 11.01 {{CompatUnknown}}
type=text 1.0 {{CompatGeckoDesktop("1.7 or earlier")}} 2 1.0 1.0
type=time 5.0 (recognized but no UI) {{CompatNo}}
{{unimplemented_inline("446510")}}
{{CompatNo}} 10.62 {{CompatVersionUnknown}} (recognized but no UI)
type=url 5.0 {{CompatGeckoDesktop("2.0")}} 10 10.62 {{CompatUnknown}}
type=week 5.0 (recognized but no UI) {{CompatNo}}
{{unimplemented_inline("446510")}}
{{CompatNo}} 10.62 {{CompatVersionUnknown}} (recognized but no UI)
accept=[MIME type] 8.0 {{CompatGeckoDesktop("16.0")}} {{CompatUnknown}} {{CompatVersionUnknown}} {{CompatNo}}
accept=audio/* {{CompatVersionUnknown}} {{CompatGeckoDesktop("2.0")}}
Filters for the following audio file extensions: .aac, .aif, .flac, .iff, .m4a, .m4b, .mid, .midi, .mp3, .mpa, .mpc, .oga, .ogg, .ra, .ram, .snd, .wav, .wma
{{CompatUnknown}} {{CompatNo}} {{CompatNo}}
accept=video/* {{CompatVersionUnknown}} {{CompatGeckoDesktop("2.0")}}
Filters for the following video file extensions: .avi, .divx, .flv, .m4v, .mkv, .mov, .mp4, .mpeg, .mpg, .ogm, .ogv, .ogx, .rm, .rmvb, .smil, .webm, .wmv, .xvid
{{CompatUnknown}} {{CompatNo}} {{CompatNo}}
accept=image/* {{CompatVersionUnknown}} {{CompatGeckoDesktop("2.0")}}
Filters for the following image file extensions: .jpe, .jpg, .jpeg, .gif, .png, .bmp, .ico, .svg, .svgz, .tif, .tiff, .ai, .drw, .pct, .psp, .xcf, .psd, .raw
{{CompatUnknown}} {{CompatNo}} {{CompatNo}}
accesskey 1.0 {{CompatVersionUnknown}} 6 1.0 {{CompatUnknown}}
mozactionhint {{CompatNo}} {{CompatGeckoDesktop("2.0")}} {{CompatNo}} {{CompatNo}} {{CompatNo}}
autocomplete 17.0 {{CompatGeckoDesktop("2.0")}} 5 9.6 5.2
autofocus 5.0 {{CompatGeckoDesktop("2.0")}} 10 9.6 5.0
checked 1.0 {{CompatGeckoDesktop("1.7 or earlier")}} 2 1.0 1.0
disabled 1.0 {{CompatGeckoDesktop("1.7 or earlier")}} 6 1.0 1.0
form 9.0 {{CompatGeckoDesktop("2.0")}} {{CompatUnknown}} 10.62 {{CompatUnknown}}
formaction 9.0 {{CompatGeckoDesktop("2.0")}} 10 10.62 5.2
formenctype 9.0 {{CompatGeckoDesktop("2.0")}} 10 10.62 {{CompatUnknown}}
formmethod 9.0 {{CompatGeckoDesktop("2.0")}} 10 10.62 5.2
formnovalidate 5.0 (in 6.0 only worked with HTML5 doctype, validation support in 7.0 was disabled and re-enabled in 10.0) {{CompatGeckoDesktop("2.0")}} 10 10.62 {{CompatUnknown}}
formtarget 9.0 {{CompatGeckoDesktop("2.0")}} 10 10.62 5.2
height 1.0 {{CompatGeckoDesktop("16.0")}} {{CompatUnknown}} 1.0 {{CompatUnknown}}
inputmode {{CompatNo}} {{CompatNo}} {{CompatNo}} {{CompatNo}} {{CompatNo}}
list 20.0 {{CompatGeckoDesktop("2.0")}} 10 9.6 {{CompatNo}}
max 5.0 {{CompatGeckoDesktop("16.0")}} {{CompatUnknown}} 10.62 {{CompatUnknown}}
maxlength 1.0 {{CompatGeckoDesktop("1.7")}} 2 1.0 1.0
min 5.0 {{CompatGeckoDesktop("16.0")}} {{CompatUnknown}} 10.62 {{CompatUnknown}}
minlength {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
multiple 1.0 (supported for type=file and type=email as of 5.0) {{CompatGeckoDesktop("1.9.2")}} for type=file
{{CompatVersionUnknown}} for type=email
10 1.0 (10.62 support for type=file and as of 11.01 type=email) {{CompatUnknown}}
name 1.0 {{CompatGeckoDesktop("1.7 or earlier")}} 2 1.0 1.0
pattern 5.0 {{CompatGeckoDesktop("2.0")}} 10 9.6 {{CompatNo}}
placeholder 10.0 {{CompatGeckoDesktop("2.0")}} 10 11.00 5.0
readonly 1.0 {{CompatGeckoDesktop("1.7 or earlier")}} 6 (missing for type of checkbox, radio) 1.0 1.0
required 5.0 (support for select element as of 10) {{CompatGeckoDesktop("2.0")}} 10 9.6 {{CompatNo}}
size 1.0 {{CompatGeckoDesktop("1.7 or earlier")}} 2 1.0 1.0
spellcheck 10.0 {{CompatGeckoDesktop("1.9.2")}} 10 11.0 4.0
src 1.0 {{CompatGeckoDesktop("1.7 or earlier")}} 2 1.0 1.0
step 6.0 {{CompatGeckoDesktop("16.0")}} 10 10.62 5.0
tabindex 1.0 {{CompatGeckoDesktop("1.7 or earlier")}} 6 (elements with tabindex > 0 are not navigated) {{CompatVersionUnknown}} {{CompatUnknown}}
width 1.0 {{CompatGeckoDesktop("16.0")}} {{CompatUnknown}} 1.0 {{CompatUnknown}}
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{CompatVersionUnknown}} {{CompatGeckoMobile("2.0")}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
type {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
type=button {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
type=checkbox {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
type=color {{CompatUnknown}} {{CompatGeckoDesktop("27.0")}} {{CompatUnknown}} {{CompatVersionUnknown}} {{CompatUnknown}}
type=date {{CompatNo}} {{CompatNo}} {{CompatNo}} 10.62 5.0
type=datetime {{CompatNo}} {{CompatNo}} {{CompatNo}} 10.62 {{CompatVersionUnknown}}
type=datetime-local {{CompatNo}} {{CompatNo}} {{CompatNo}} 10.62 {{CompatVersionUnknown}}
type=email {{CompatUnknown}} {{CompatGeckoMobile("2.0")}} {{CompatUnknown}} {{CompatVersionUnknown}} 3.1 (no validation but gives a specific keyboard)
type=file {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
type=hidden {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
type=image {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
type=month {{CompatNo}} {{CompatNo}} {{CompatNo}} 10.62 {{CompatVersionUnknown}}
type=number 2.3 (no validation but gives a specific keyboard) {{CompatGeckoMobile("29.0")}} {{CompatUnknown}} {{CompatVersionUnknown}} 4.0 (no validation but gives a specific keyboard)
type=password {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
type=radio {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
type=range {{CompatUnknown}} {{CompatNo}} {{CompatUnknown}} {{CompatVersionUnknown}} 5.0
type=reset {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
type=search {{CompatUnknown}} {{CompatGeckoMobile("2.0")}} {{CompatUnknown}} 10.62 4.0
type=submit {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
type=tel 2.3 {{CompatGeckoMobile("2.0")}} {{CompatUnknown}} 10.62 3.1
type=text {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
type=time {{CompatNo}} {{CompatNo}} {{CompatNo}} 10.62 {{CompatVersionUnknown}}
type=url {{CompatUnknown}} {{CompatGeckoMobile("2.0")}} {{CompatUnknown}} 10.62 3.1 (no validation but gives a specific keyboard)
type=week {{CompatNo}} {{CompatNo}} {{CompatNo}} 10.62 {{CompatVersionUnknown}}
accept=[MIME type] {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
accept=audio/* {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
accept=image/* {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
accept=video/* {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
accesskey {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
autocomplete {{CompatUnknown}} {{CompatGeckoMobile("2.0")}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
autofocus 3.2 {{CompatGeckoMobile("2.0")}} {{CompatUnknown}} {{CompatVersionUnknown}} {{CompatUnknown}}
checked {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
disabled {{CompatVersionUnknown}} {{CompatGeckoMobile("2.0")}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
form {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
formaction {{CompatUnknown}} {{CompatGeckoMobile("2.0")}} {{CompatUnknown}} 10.62 5.0
formenctype {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
formmethod {{CompatUnknown}} {{CompatGeckoMobile("2.0")}} {{CompatUnknown}} 10.62 5.0
formnovalidate {{CompatUnknown}} {{CompatGeckoMobile("2.0")}} {{CompatUnknown}} 10.62 {{CompatUnknown}}
formtarget {{CompatUnknown}} {{CompatGeckoMobile("2.0")}} {{CompatUnknown}} 10.62 5.0
height {{CompatUnknown}} {{CompatGeckoMobile("16.0")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
list {{CompatNo}} {{CompatGeckoMobile("2.0")}} {{CompatUnknown}} {{CompatVersionUnknown}} {{CompatUnknown}}
max {{CompatUnknown}} {{CompatNo}} {{bug("556010")}} {{CompatUnknown}} 10.62 {{CompatUnknown}}
maxlength {{CompatVersionUnknown}} {{CompatGeckoMobile("2.0")}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
min {{CompatUnknown}} {{CompatNo}} {{bug("556010")}} {{CompatUnknown}} 10.62 {{CompatUnknown}}
minlength {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
multiple {{CompatUnknown}} {{CompatVersionUnknown}} {{CompatUnknown}} {{CompatVersionUnknown}} {{CompatUnknown}}
name {{CompatVersionUnknown}} {{CompatGeckoMobile("2.0")}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} 1.0
pattern {{CompatUnknown}} {{CompatGeckoMobile("2.0")}} {{CompatUnknown}} {{CompatVersionUnknown}} {{CompatUnknown}}
placeholder 2.3 {{CompatGeckoMobile("2.0")}} {{CompatUnknown}} 11.10 4
readonly {{CompatVersionUnknown}} {{CompatGeckoMobile("2.0")}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
required {{CompatUnknown}} {{CompatVersionUnknown}} {{CompatUnknown}} {{CompatVersionUnknown}} {{CompatUnknown}}
size {{CompatVersionUnknown}} {{CompatGeckoMobile("2.0")}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
spellcheck {{CompatUnknown}} {{CompatGeckoMobile("2.0")}} {{CompatUnknown}} 11.0 {{CompatUnknown}}
src {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
step {{CompatUnknown}} {{CompatNo}} {{bug("556009")}} {{CompatUnknown}} 10.62 {{CompatUnknown}}
tabindex {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
width {{CompatUnknown}} {{CompatGeckoMobile("16.0")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}

Gecko notes

Starting in Gecko 9.0 {{geckoRelease("9.0")}}, Firefox for Android lets users capture images using their camera and upload them, without having to leave the browser. Web developers can implement this feature by simply specifying setting the accept attribute's value to "image/*" on their file input, like this:

<input type="file" accept="image/*">

See also