Skip to main content

aria-valid-attr-value

Severity: Critical

Description

All ARIA attributes should contain only valid values. Most of the ARIA attributes have a list of expected values. If an invalid value is used in an ARIA attribute, screen readers and other assistive technologies can’t recognize the value and the webpage will become inaccessible to users of assistive technologies.

Example

In the following example, the aria-expanded attribute is defined as sometimes, which is invalid. Such invalid values for ARIA attributes make the webpage inaccessible and break the aria-valid-attr-value rule.

Incorrect sample - aria-expanded
Copy icon Copy snippet

In contrast, the following code snippet assigns a valid value true to the aria-expanded attribute. Hence, this code snippet doesn’t break the aria-valid-attr-value rule.

Correct sample - aria-expanded
Copy icon Copy snippet

How to fix?

You can follow these steps to fix issues if this rule gets flagged:

  • Check if your webpage uses an invalid value for any ARIA attribute.

  • If so, assign a valid value to the ARIA attribute.

Reference

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback!

Talk to an Expert
Download Copy