roles and attributes help screen readers
provide missing information about an element.
For these roles and attributes to make sense,
role supports a specific subset of
(see ARIA roles definitions).
Assistive technologies, like screen readers,
can't interpret ARIA attributes with invalid values.
Lighthouse reports when attributes do not have valid values:
Key Term: ARIA attributes let you modify the way HTML elements are represented to assitive technologies like screen readers. Learn more in this Introduction to ARIA.
How Lighthouse determines an attribute's value is invalid
Lighthouse uses the
WAI ARIA specification - Definition of roles
to check the values of roles and their attrbutes.
Lighthouse fails this audit,
when it finds attributes with invalid values.
In the example Lighthouse audit above,
aria-checked should be set to either
HTML boolean attributes such as
checked are assumed to be either
true or false depending on if they are present on the element.
How this audit impacts overall Lighthouse score
Lighthouse flags this as a low severity issue. It is important to fix, and probably indicates a mistaken assumption in your code. In the example above, the element is still announced as a checkbox but it will have an implicit checked state of "unchecked.
How to check for invalid attribute values
To check for invalid attribute values, refer to the WAI ARIA Definition of roles. ARIA defines a role's allowable attributes, and the valid values for those attributes. Check that you are using the correct values for any attributes you use in your roles.
For more information on this audit, see ARIA attributes must conform to valid values.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.