button
<button> . . . </button>
Used as part of a form, defines a clickable button that functions
similarly to buttons created with the input
element
but allows for richer rendering possibilities. Buttons can contain
content such as text and images (but not image maps).
Flow content, phrasing content, interactive content, “listed, labelable, and submittable form-associated element”, palpable content
Where phrasing content is expected
Phrasing content, but may contain no interactive content
Required/Required
HTML5 Global Attributes
autofocus
(autofocus="autofocus"
in XHTML)Not in HTML 4.01. Indicates the control should have focus (be highlighted and ready for user input) when the document loads.
disabled
(disabled="disabled"
in XHTML)Disables the control for user input. It can be altered only via a script. Browsers may display disabled controls differently (grayed out, for example), which could be useful for dimming certain controls until required info is supplied.
form="
id of the form
owner
"
Not in HTML 4.01.
Explicitly associates the input control with its associated form (its
form owner). With this method, the input
control does not need to be a child of the
form
element that applies to it.
formaction="
URL
"
Not in HTML 4.01.
Specifies the application that will process the
form. It is used only with a submit button (input
type=
"submit"
) and has the same
function as the action
attribute for the
form
element.
formenctype="
content
type
"
Not in HTML 4.01.
Specifies how the form values are encoded with the
post
method type. It is used only with a
submit button (input type="submit"
) and has
the same function as the enctype
attribute
for the form
element. The default is Internet Media Type
(application/x-www-form-urlencoded
). The
value multipart/form-data
should be used in
combination with the file
input type. The
value text/plain
sets the MIME type of the
submitted data to be text/plain.
formmethod="get|post"
Not in HTML 4.01.
Specifies which HTTP method will be used to submit the form
data. It is used only with a submit button (input
type="submit"
) and has the same function as the
method
attribute for the
form
element.
formnovalidate="
URL
"
Not in HTML 4.01.
Indicates that the form is not to be validated during
submission. It is used only with a submit button (input
type="submit"
) and has the same function as the
novalidate
attribute for
the form
element (new in HTML5).
formtarget="
name
"
Not in HTML 4.01.
Specifies the target window for the form results. It is used only with a submit
button (input type=
"submit"
) and has the same
function as the target
attribute for the
form
element.
menu="
text
"
Not in HTML 4.01. If
the button’s type
attribute is set
to menu
, this attribute is required to
provide the ID of a menu
element on the same
page with its type
set to
popup
.
name="
text
"
type="submit|reset|button|menu"
Identifies the behavior of the button: submit
(submit
button, the default type), reset
(reset
button), button
(custom button controlled
with JavaScript), or menu
(shows a
menu).
value="
text
"
Assigns the value to the button control. The behavior of the button is
determined by the type
attribute.