[role="img"] and [role="image"] elements must have alternative text
How to fix the role-img-alt accessibility rule. Images and text alternatives.
What this rule checks
Ensure [role="img"] and [role="image"] elements have alternative text
Who is affected
An element marked role="img" has no text alternative, so it is silent to screen readers.
How to fix it
Add an aria-label (or aria-labelledby) describing the image.
Example
Before
<div role="img" class="chart"></div>After
<div role="img" class="chart" aria-label="Sales rose 20% from 2024 to 2025"></div>WCAG success criteria
When this rule fails, the page fails:
- 1.1.1 Non-text Content (Level A, WCAG 2.0, 2.1, 2.2)
Find it on your own page
Scan a web page and the report lists every element that fails this rule, with screenshots outlining where they are, the code, and a selector you can paste into your browser’s developer tools.
More detail
- Deque University’s reference for role-img-alt (the makers of axe-core, the engine our scanner uses)
- All fix guides