jump

HTML: The Markup Language Reference

button type=submitsubmit button # T

The button element with a type attribute whose value is "submit" represents a button for submitting a form.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.
name = string #
The name part of the name/value pair associated with this element for the purposes of form submission.
disabled = "disabled" or "" (empty string) or empty #
Specifies that the element represents a disabled control.
form = ID reference NEW #
The value of the id attribute on the form with which to associate the element.
type = "submit" #
Specifies that its button element is a button for submitting a form.
value = string #
The value part of the name/value pair associated with this button for the purposes of form submission.
formaction = URL potentially surrounded by spaces NEW #
The form-submission action for the element.
autofocus = "autofocus" or "" (empty string) or empty NEW #
Specifies that the element represents a control to which a UA is meant to give focus as soon as the document is loaded.
formenctype = "application/x-www-form-urlencoded" or "multipart/form-data" or "text/plain" NEW #
A MIME type with which a UA is meant to associate this element for form submission.
formmethod = "get" or "post" NEW #
The HTTP method with which a UA is meant to associate this element for form submission.
formtarget = browsing-context name or keyword NEW #
A browsing context name or keyword that represents the target of the control.
Any string that is either of the following:
formnovalidate = "formnovalidate" or "" (empty string) or empty NEW #
Specifies that the element represents a control whose value is not meant to be validated during form submission.

Additional constraints and admonitions #

Tag omission #

A button element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLButtonElement : HTMLElement {
           attribute boolean autofocus;
           attribute boolean disabled;
  readonly attribute HTMLFormElement form;
           attribute DOMString formAction;
           attribute DOMString formEnctype;
           attribute DOMString formMethod;
           attribute DOMString formNoValidate;
           attribute DOMString formTarget;
           attribute DOMString name;
           attribute DOMString type;
           attribute DOMString value;

  readonly attribute boolean willValidate;
  readonly attribute ValidityState validity;
  readonly attribute DOMString validationMessage;
  boolean checkValidity();
  void setCustomValidity(in DOMString error);

  readonly attribute NodeList labels;
};