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
- The form Element action method enctype
- Input Types text password email number tel
- The label Element and Accessibility
- The button Element submit reset button