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)
Fixable:
No

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)
> 1 | <fieldset></fieldset>
    |  ^^^^^^^^


1 error found.

Examples of correct code for this rule:

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