Uses ARIA roles only on compatible elements

Accessibility roles are only applied to elements that support them.

On this page

Impact

ScanGov impact ratings

About

Many HTML elements can only be assigned certain ARIA roles. Using ARIA roles where they are not allowed can interfere with the accessibility of the web page.

Risks

Screen readers misinterpret elements assigned unsupported roles.

Why it's important

Ensures assistive technologies like screen readers can correctly interpret and announce page elements to users with disabilities.

User stories

As a screen reader user, I want ARIA attributes to be correctly implemented so that I can understand the purpose and state of interactive elements.

Code

Failing pattern:

<!-- Fail: role="dialog" not allowed on a table caption -->
<caption role="dialog">Report data</caption>

Passing pattern:

<!-- Pass: use an appropriate element -->
<caption>Report data</caption>

Error

ScanGov messaging when a site fails a standard:

Failed: Uses ARIA roles only on compatible elements

Guidance

Indicators

On this page