Checkboxes in HTML
Independent on/off choices, each with its own name or a shared one.
<fieldset>
<legend>Practice languages</legend>
<label>
<input type="checkbox" name="langs" value="python" checked>
Python
</label>
<label>
<input type="checkbox" name="langs" value="sql">
SQL
</label>
<label>
<input type="checkbox" name="quiet" value="1">
Mute keystrokes
</label>
</fieldset>
How it works
checkedsets the initial state.- Sharing a name posts several values under that one key.
- An unchecked box is simply absent from the submission.
The run, in numbers
- Lines
- 15
- Characters to type
- 292
- Tokens
- 76
- Three-star pace
- 70 tpm
At the three-star pace of 70 tokens a minute, this run takes about 65 seconds.
Step 1 of 6 in Choices, step 9 of 25 in Forms & inputs.