Grouping related controls into meaningful sections helps people understand a form and reduces its perceived workload. Use `<fieldset>` with `<legend>` to make the relationship clear visually and programmatically; CSS borders alone do not convey it to assistive technology. section 6.1.4
<fieldset> #A
<legend>Dog size</legend> #B
<div>
<input type="radio" name="size" id="small" value="s" checked> #C
<label for="small">Small</label>
</div>
<div>
<input type="radio" name="size" id="medium" value="m"> #C
<label for="medium">Medium</label>
</div>
<div>
<input type="radio" name="size" id="large" value="l"> #C
<label for="large">Large</label>
</div>
</fieldset>A radio-button group titled “Dog size” shows `<fieldset>` and `<legend>` around individually labeled choices. section 6.1.4
Use grouping when controls belong together, especially for:
- Related radio buttons, checkboxes, or fields split into components such as month, day, and year. section 6.1.4
- Large forms divided into meaningful sections, such as owner, dog, and complaint details. section 6.1.10
A screen reader can announce a control’s label alongside its group legend, providing context such as “Name – Billing Details.” Native radio groups also provide expected keyboard behavior; a custom group requires implementing and communicating its behavior, role, name, and state. section 6.1.4 section 6.1.3
