HTML Buttons
All HTML topics∙ Chapter 59
HTML Buttons
Use <button> for actions, and <a> for navigation. Always set the type inside forms.
| Button type | What it does | Example |
|---|---|---|
| submit | Submits the form | type="submit" |
| button | Does nothing by default (use JS) | type="button" |
| reset | Resets form fields | type="reset" |
⚠️Inside a form, a
<button> defaults to type="submit". Set type="button" for JS buttons.