WCAG H71: Providing a description for groups of form controls

Rule ID:
wcag/h71
Category:
Accessibility
Standards:
  • WCAG 2.2 (A)
  • WCAG 2.1 (A)
  • WCAG 2.0 (A)

WCAG H71 requires all fieldsets to have a <legend> element as first child element.

Rule details

Examples of incorrect code for this rule:

<fieldset>
	...
</fieldset>
error: <fieldset> must have a <legend> as the first child (wcag/h71) at inline:1:2:
> 1 | <fieldset>
    |  ^^^^^^^^
  2 | 	...
  3 | </fieldset>


1 error found.

Examples of correct code for this rule:

<fieldset>
	<legend>Lorem ipsum</legend>
		...
</fieldset>