...
As a screen reader user I should be provided with a "legend" that describes the group of form controls.
Groups of form controls (such as a list of checkboxes, list of radio buttons, group of input fields) sometimes require a higher-level label. This information can be associated to the group of form controls using <fieldset>
and <legend>
. The <fieldset>
defines the group and the <legend>
contains the description. Screen readers announce the <legend>
when users navigate into the group.
...
Markup and Code
Code Block | ||
---|---|---|
| ||
<fieldset> <legend>Choose a shipping method:</legend> <input id="overnight" type="radio" name="shipping" value="overnight"> <label for="overnight">Overnight</label><br> <input id="twoday" type="radio" name="shipping" value="twoday"> <label for="twoday">Two day</label><br> <input id="ground" type="radio" name="shipping" value="ground"> <label for="ground">Ground</label> </fieldset> |
...