0Pricing
HTML Academy · Lesson

The button Element submit reset button

Trigger form submission, reset, or custom actions with buttons.

The button Element

The <button> element is the primary way to create clickable controls:

<button type="submit">Submit</button>
<button type="reset">Clear Form</button>
<button type="button">Do Something</button>

<!-- Three types, each with a different default behavior -->
<!-- Always specify type — the default is submit inside forms -->

type=submit

type="submit" submits the form when clicked:

<form action="/register" method="post">
  <input type="email" name="email">
  <button type="submit">Create Account</button>
</form>
<!-- Triggers form validation, then sends the form data -->
<!-- Also triggered by pressing Enter in most text inputs -->

All lessons in this course

  1. The form Element action method enctype
  2. Input Types text password email number tel
  3. The label Element and Accessibility
  4. The button Element submit reset button
← Back to HTML Academy