HTML Button Types: Submit, Reset and Button
Submit buttons
type="submit" initiates form submission when activated, subject to validation. A regular button inside a form with omitted type usually behaves as a submit button. The activated submitter can contribute its own name and value.
<form action="/draft" method="post"> <label> Title <input name="title" value="Plan"> </label> <button type="submit" name="intent" value="save">Save draft</button></form>The submitter declares intent=save when it initiates the submission. The endpoint is illustrative only.
A plain button
type="button" has no built-in form submission or reset action. It can be used for a separate action implemented by a script. Native buttons already support keyboard activation.
<form> <label> Title <input name="title" value="Plan"> </label> <button type="button">Preview title</button></form>This plain button does not submit and has no preview script in this example.
Reset buttons
type="reset" restores form controls to their default values; it does not necessarily make every field empty. A reset button is different from a delete operation on server data.
<form> <label> Room <input name="room" value="A1"> </label> <button type="reset">Restore room</button></form>Change A1, then click Restore room. A1 returns.
Common mistakes and practice
Specify a type explicitly, particularly for buttons inside forms. Avoid reset buttons unless restoring initial values is useful; accidental loss of edits can frustrate users. Provide visible action text. A submit button does not save information without an implementation at the destination.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
HTML Button Types: Submit, Reset and Button — Knowledge Check
Apply the form-control concepts from this lesson.
Which type does not automatically submit or reset a form?
What does reset restore?
Why specify type on a regular button inside a form?
Which button type initiates normal form submission?
A button opens a local help panel inside a form. Which type should be explicit?