
org.sonar.l10n.web.rules.Web.S6807.html Maven / Gradle / Ivy
Why is this an issue?
ARIA (Accessible Rich Internet Applications) attributes are used to enhance the accessibility of web content and web applications. These attributes
provide additional information about an element’s role, state, properties, and values to assistive technologies like screen readers.
Each role in ARIA has a set of required attributes that must be included for the role to be properly understood by assistive technologies. These
attributes are known as "required aria-* properties".
For example, if an element has a role of "checkbox", it must also include the aria-checked property. This property indicates whether the checkbox
is checked (true), unchecked (false), or in a mixed state (mixed).
This rule checks that each element with a defined ARIA role also has all required attributes.
How to fix it
Check that each element with a defined ARIA role also has all required attributes.
<div role="checkbox">Unchecked</div> <!-- Noncompliant: aria-checked is missing -->
To fix the code add missing aria-* attributes.
<div role="checkbox" aria-checked="false">Unchecked</div>
Resources
Documentation
- MDN web docs - Using ARIA: Roles, states, and
properties
- MDN web docs - ARIA roles (Reference)
- MDN web docs - ARIA states and properties (Reference)
Standards