HTML Forms
Buttons
The <button> element creates a clickable button. Its type decides what it does.
| Type | What it does |
|---|---|
submit | Submits the form (the default inside a form). |
reset | Clears all inputs back to their starting values. |
button | Does nothing by itself. Use it with JavaScript. |
<form>
<input name="name" placeholder="Name">
<button type="submit">Send</button>
<button type="reset">Clear</button>
<button type="button" onclick="alert('Hi!')">Say hi</button>
</form>