Buttons in HTML
Three button types, and why type matters inside a form.
<form action="/api/results" method="post">
<button type="submit">Save result</button>
<button type="reset">Clear</button>
<button type="button" id="retry">Try again</button>
<button type="submit" disabled>Publishing...</button>
</form>
How it works
submitis the default — state it anyway to be explicit.resetclears the form;buttondoes nothing until scripted.disabledblocks the click and dims the control.
The run, in numbers
- Lines
- 6
- Characters to type
- 235
- Tokens
- 61
- Three-star pace
- 75 tpm
At the three-star pace of 75 tokens a minute, this run takes about 49 seconds.
Step 4 of 5 in Validation & submission, step 22 of 25 in Forms & inputs.