Fieldset label (group-label)

Group related form fields with <fieldset> and include a descriptive <legend> for each group.


Aria-labelledby instead of a legend:

In this example aria-labelledby is used instead of a <legend> element:

In other words, this <fieldset> lacks a <legend>.


Choose a color:

The (DOM/programmatic) structure of the above example looks like this:

<fieldset aria-labelledby="color-label">
<input type="radio" name="color" value="red" />
Red
<input type="radio" name="color" value="blue" /> Blue
</fieldset>
<span id="color-label">Choose a color:</span>

Note: Impossible to automatically test or detect. Requires a human tester or AI to determine if a <fieldset> element is needed and where, and ensure that a <fieldset> exists if necessary.

axe detected: none  |  QualWeb detected: 1.3.1