An Image ARIA Role is missing required aria attributes
| Field | Value |
|---|---|
| Rule code | Img_AttributeRequirement_Missing |
| WCAG conformance level | A |
| WCAG success criterion | 4.1.2 Name, Role, Value |
| Must be fixed at source | No |
Description
The Image ARIA Roles must include an aria-label or aria-labelledby ARIA attributes to be fully accessible to assistive technologies. For the HTML <img> element, use the alt attribute. For all other elements with the img role, use aria-labelledby if a visible label is present, otherwise use aria-label. Missing prop attribute and value on a Heading role can lead to incomplete or incorrect interpretation of the heading. More details on ARIA role requirements are available here: https://www.w3.org/TR/wai-aria-1.1/#img.
How to fix
Ensure every element with role='img' has an 'aria-label' if no visual label exists (e.g., <div role='img' aria-label='Descriptive text'></div>), or an 'aria-labelledby' if a visible label is present (e.g., <div role='img' aria-labelledby='labelID'></div> with a corresponding <label id='labelID'>Visible Label</label>).