--- title: slug: Web/HTML/Element/Input/button tags: - Eingabeelement - Element - HTML - Referenz translation_of: Web/HTML/Element/input/button ---

{{HTMLRef}}

Das HTML <input type="button"> Element ist eine bestimmte Version des <input> Elements. Es wird benutzt, um einen anklickbaren Button zu generieren, der jedoch keinen voreingestellten Wert hat.

Browser generieren einen Controller für clickbare Buttons ohne Standartwert. Ein Button kann beliebige Beschriftungen besitzen. Der Controller selbst variiert von Browser zu Browser.

Content categories Flow content, phrasing content, Interactive content, listed, labelable, and submittable form-associated element, palpable content.
Permitted content Phrasing content.
Tag omission None, both the starting and ending tag are mandatory. 
Permitted parent elements Any element that accepts phrasing content.
DOM interface HTMLButtonElement
Element Typ Inline

Attributes

Dieses Element kann zusätzlich zu den globalen Attribute jedes der folgenden besitzen:

{{htmlattrdef("disabled")}}

This Boolean attribute indicates that the user cannot interact with the button. If this attribute is not specified, the button inherits its setting from the containing element, for example {{HTMLElement("fieldset")}}; if there is no containing element with the disabled attribute set, then the button is enabled. The disabled control's value isn't submitted with the form and the click event will not be dispatched on disabled controls.

Firefox will, unlike other browsers, by default, persist the dynamic disabled state of a {{HTMLElement("button")}} across page loads. Use the {{htmlattrxref("autocomplete","button")}} attribute to control this feature.

{{htmlattrdef("autofocus")}} {{HTMLVersionInline(5)}}
This Boolean attribute lets you specify that the button should have input focus when the page loads, unless the user overrides it, for example by typing in a different control. Only one form-associated element in a document can have this attribute specified.
{{htmlattrdef("autocomplete")}} {{non-standard_inline}}
The use of this attribute on a {{HTMLElement("button")}} is nonstandard and Firefox-specific. By default, unlike other browsers, Firefox persists the dynamic disabled state of a {{HTMLElement("button")}} across page loads. Setting the value of this attribute to off (i.e., autocomplete="off") disables this feature.
{{htmlattrdef("form")}} {{HTMLVersionInline(5)}}
The form element that the button is associated with (its form owner). The value of the attribute must be the id attribute of a {{HTMLElement("form")}} element in the same document. If this attribute is not specified, the <button> element must be a descendent of a form element. This attribute enables you to place <button> elements anywhere within a document, not just as descendents of their {{HTMLElement("form")}} elements.
{{htmlattrdef("formenctype")}}
Since the input element is a submit button, the formenctype 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("formaction")}} {{HTMLVersionInline(5)}}
The URI of a program that processes the information submitted by the button. If specified, it overrides the {{htmlattrxref("action","form")}} attribute of the button's form owner.
{{htmlattrdef("formmethod")}}
Since the input element is a submit button, the formmethod 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")}}
Since the input element is a submit button, the formnovalidate 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. This is a Boolean attribute.
{{htmlattrdef("formtarget")}}
Since the input element is a submit button, the formtarget 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 element's form owner. The following keywords have special meanings:
{{htmlattrdef("name")}}
Der Name der Schaltfläche, der mit den Formulardaten übermittelt wird.
{{htmlattrdef("type")}}
The type of the button. Possible values are:
{{htmlattrdef("value")}}
The initial value of the button.

Beispiele

<input type="button" value="Klick mich">

Das erstellt einen neuen Button mit der Beschriftung: 'Klick mich'.

Specifications

Specification Status
{{SpecName('HTML WHATWG', 'the-button-element.html#the-button-element', '<button>')}} {{Spec2('HTML WHATWG')}}
{{SpecName('HTML5 W3C', 'forms.html#the-button-element', '<button>')}} {{Spec2('HTML5 W3C')}}
{{SpecName('HTML4.01', 'interact/forms.html#h-17.5', '<button>')}} {{Spec2('HTML4.01')}}

Browser Compatibiltiy

Browser Compatibility
Feature Chrome Gecko (Firefox) Internet Explorer Opera Safari
Basic support 1.0 {{CompatGeckoDesktop("1.0")}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
formenctype attribute 9.0 {{CompatGeckoDesktop("2.0")}} 10 10.6 {{CompatUnknown}}
formmethod attribute 9.0 {{CompatGeckoDesktop("2.0")}} 10 {{CompatUnknown}} {{CompatUnknown}}
autofocus attribute 5.0 {{CompatGeckoDesktop("2.0")}} 10 9.6 5.0
formaction attribute 9.0 {{CompatGeckoDesktop("2.0")}} 10 {{CompatUnknown}} {{CompatUnknown}}
Mobile Browser Compatibility
Feature Android Gecko (Firefox Mobile) Internet Explorer Mobile Opera Mobile Safari Mobile
Basic Support {{CompatVersionUnknown}} {{CompatGeckoMobile("1.0")}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
formaction attribute {{CompatUnknown}} {{CompatGeckoMobile("2.0")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
formenctype attribute {{CompatUnknown}} {{CompatGeckoMobile("2.0")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
formmethod attribute {{CompatUnknown}} {{CompatGeckoMobile("2.0")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}

See also