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
formelement 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 attributeactionof theformelement.formenctype="Inhaltstyp"HTML 5 only. Specifies how form values are encoded when the
postmethod is used to submit the form. Used only with a submit button (button type="submit"). Has the same function as the attributeenctypefor theformelement. The default Internet media type is (application/x-www-form-urlencoded). If the input typefileis used, the valuemultipart/form-datashould 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 attributemethodfor theformelement. The valuesputanddeleteare 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 attributenovalidatefor theformelement, 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 thetargetattribute for theformelement.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>
|
Copyright © 2010 O’Reilly Verlag GmbH & Co. KG
You may print the online version for your private use.
Otherwise, this chapter from "HTML & XHTML ─ kurz & gut" is subject to the same provisions as the printed edition: the work, including all its parts, is protected by copyright. All rights are reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
O’Reilly Verlag GmbH & Co. KG, Balthasarstraße 81, 50670 Köln, kommentar(at)oreilly.de