Form Buttons
button type submit sends the form, reset clears it and button does nothing until JavaScript handles it. Prefer button over input type submit because it can hold HTML.
Example
<form>
<input name="x">
<button type="submit">Send</button>
<button type="reset">Clear</button>
<button type="button" onclick="alert(1)">Alert</button>
</form>Exercise
A button that clears fields.
<button type="">Clear</button>
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.