Checkboxes & Radio Buttons
HC · Formssyntax
<input type="checkbox" name="field" value="val">
<input type="radio" name="group" value="val">example
<fieldset>
<legend>Notification Preferences</legend>
<label><input type="checkbox" name="notify" value="email"> Email</label>
<label><input type="checkbox" name="notify" value="sms"> SMS</label>
</fieldset>
<fieldset>
<legend>Priority</legend>
<label><input type="radio" name="priority" value="low"> Low</label>
<label><input type="radio" name="priority" value="high"> High</label>
</fieldset>Note Radio buttons with the same name attribute form an exclusive group where only one can be selected. Checkboxes allow multiple selections. Wrap each in a label for a clickable hit area.