lang attribute must have a valid value
How to fix the valid-lang accessibility rule. Language.
What this rule checks
Ensure lang attributes have valid values
Who is affected
A lang attribute on part of the page has an invalid language code.
How to fix it
Use a valid code such as "fr" or "es" on that element.
WCAG success criteria
When this rule fails, the page fails:
- 3.1.2 Language of Parts (Level AA, WCAG 2.0, 2.1, 2.2)
Find it on your own page
Scan a web page and the report lists every element that fails this rule, with screenshots outlining where they are, the code, and a selector you can paste into your browser’s developer tools.
More detail
- Deque University’s reference for valid-lang (the makers of axe-core, the engine our scanner uses)
- All fix guides