image.alt.exists
- Default
- error
- Plugin
image
An <img> has an alt attribute.
Why: Search engines and screen readers use alt text to understand images. An empty alt="" is allowed: it marks a decorative image that should be skipped.
When off: images without alt pass.
<!-- ✗ Fails -->
<img src="/bread.jpg" />
<!-- ✓ Passes -->
<img src="/bread.jpg" alt="A basket of fresh bread" />
<img src="/divider.svg" alt="" />
References
- Google: Image SEO best practices: Google calls a missing
altbad, and uses alt text to understand images. - WCAG 2.2: Understanding Non-text Content: Images need a text alternative (Level A).
- axe: image-alt: The same check in axe-core.