HTML Buttons

All HTML topics
∙ Chapter 59

HTML Buttons

Use <button> for actions, and <a> for navigation. Always set the type inside forms.

Button typeWhat it doesExample
submitSubmits the formtype="submit"
buttonDoes nothing by default (use JS)type="button"
resetResets form fieldstype="reset"
⚠️Inside a form, a <button> defaults to type="submit". Set type="button" for JS buttons.