Ensure ARIA attributes are valid and not misspelled or non-existent

ARIA roles and attributes help screen readers provide missing information about an element. For these roles and attributes to make sense, each ARIA role supports a specific subset of aria-* attributes (see ARIA roles definitions). Assistive technologies, like screen readers, can't interpret ARIA attributes with invalid names. Lighthouse reports ARIA attributes with invalid values:

Lighthouse audit showing ARIA attribute has invalid value
ARIA attribute has invalid value.

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 checks for invalid attribute values

Lighthouse uses the WAI ARIA specification: Definition of Roles to check accepted values for roles and attributes.

Lighthouse fails this audit, when it finds an attribute with an invalid value. In the example Lighthouse audit above, the aria-checked attribute is undefined, when it should be either true or false. The audit fails since the attribute has an invalid value.

How to check attribute values are valid

To check attribute values refer to the WAI ARIA Definition of Roles. Check the role definition that the attribute describes, and then check the values for that attribute.

For more information on this audit, see ARIA attributes must conform to valid values.

More information

Last updated: Improve article