XML technologies / HTML & XHTML / Alphabetical list of HTML and XHTML elements / button

(Excerpt from "HTML & XHTML ─ kurz & gut" by Jennifer Niederst Robbins)

A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z

   

HTML 4.01 | HTML 5

button

<button> ... </button>

Used in web forms. Defines a button that works similarly to buttons created with the element input, but offers considerably more presentation options. The content of the element button can be text or images, but not image maps.

Start/end tag

Required/required

Attributes

Core, internationalization, events, focus, global HTML 5 attributes

  • autofocus (autofocus="autofocus" in XHTML)

    HTML 5 only. Specifies that the control should receive focus when the document loads. It is highlighted to indicate that it is ready for input.

  • disabled (disabled="disabled" in XHTML)

    Disables user input in the control. Only a script can change this. Browsers may display disabled controls differently, for example grayed out. This can dim certain controls until, for example, particular information has been entered.

  • form="ID des übergeordneten Formulars"

    HTML 5 only. Explicitly associates the control with its parent form. With this method, the control need not be a descendant of the form element to which it applies.

  • formaction="URL"

    HTML 5 only. Refers to the application processing the form. Used only with a submit button (button type="submit") and has the same function as the attribute action of the form element.

  • formenctype="Inhaltstyp"

    HTML 5 only. Specifies how form values are encoded when the post method is used to submit the form. Used only with a submit button (button type="submit"). Has the same function as the attribute enctype for the form element. The default Internet media type is (application/x-www-form-urlencoded). If the input type file is used, the value multipart/form-data should be used here.

  • formmethod="get|post|put|delete"

    HTML 5 only. Specifies the HTTP method for submitting form data. Used only with a submit button (button type="submit") and has the same function as the attribute method for the form element. The values put and delete are new in HTML 5.

  • formnovalidate="URL"

    HTML 5 only. Specifies that the form should not be validated on submission. Used only with a submit button (button type="submit") and has the same function as the attribute novalidate for the form element, new in HTML 5.

  • formtarget="Name"

    HTML 5 only. Specifies the window displaying the form’s results. Used only with the submit button (button type="submit") and has the same function as the target attribute for the form element.

  • name="text"

    Required. Defines the control’s name.

  • type="submit|reset|button"

    Specifies the button type: a submit button (the default), reset button to reset the form, or a custom button for use with JavaScript.

  • value="Text"

    Gives the button a predefined value. The button’s behavior is determined by the attribute type.

Example

<button type="reset" name="reset"><img src="daumen_runter.gif" alt="Daumen nach unten-Symbol" /> Nochmal probieren.</button>

 

> back to the alphabetical list of elements

   

 

 

 

back to top