button

button elements define actions that can be performed on the contents of a form.

Content category

Pseudo-classes

Attributes

  • disabled indicates that the control should be disabled.
  • form allows explicit association of the element with a form (using its id).
  • formaction, formenctype, formmethod, formnovalidate and formtarget override the form's corresponding elements.
  • name specifies the name of the input control, and the name against which the value will be submitted. Without this, the value will not be included in submissions.
  • type defines the default action of the button:
    • submit buttons submit the form.
    • button has no action by default.
    • reset creates a button which resets the values of all form elements to their default values. Use of this is usually an antipattern; it is not a commonly intended behaviour.
  • value sets the initial value of the input. Note that button types display this on the control.

References


Backlinks