HTML Buttons
Create buttons, learn button types, and avoid the common form mistakes.
David Miller
December 23, 2025
2.8k100
Buttons are used for actions: submit, open modal, save, etc.
Simple button
<button>Click Me</button>
Button in a form (important)
<form>
<input name="email" type="email" />
<button type="submit">Submit</button>
<button type="button">Cancel</button>
</form>
Preview
A form shows email input with Submit and Cancel buttons.
Key point
Always set button type:
- submit = sends form
- button = normal click button
#HTML#Beginner