Buttons and links without accessible names
A button or link that contains only an icon (no visible text and no aria-label) is unannounced to screen reader users. Every interactive element needs an accessible name — visible text, aria-label, or aria-labelledby.
A button or link that contains only an icon (no visible text and no aria-label) is unannounced to screen reader users. Every interactive element needs an accessible name — visible text, aria-label, or aria-labelledby. The accessible name is what a screen reader reads when focus reaches the element. For a button with visible text, that's the text. For an icon-only button, it must come from aria-label, aria-labelledby, or the title attribute on an icon image.
Last updated·
What it is
The accessible name is what a screen reader reads when focus reaches the element. For a button with visible text, that's the text. For an icon-only button, it must come from aria-label, aria-labelledby, or the title attribute on an icon image.
Why it matters
Without a name, screen reader users hear "button" or "link" with no context — they can't use your nav, your modal close, your form submit. WCAG 4.1.2 failure. Search engines also use link names to understand site structure.
How to fix it
- Add aria-label to icon-only controls. <button aria-label="Close dialog"><svg>✕</svg></button>. Choose the verb the user is performing.
- Add alt to icon images inside links. <a href="/cart"><img src="/cart.svg" alt="Cart"></a>. Empty alt would mean an empty link name.
- Audit with axe DevTools. The "button-name" and "link-name" rules catch every unnamed control.
Authoritative sources
- Google Search Central documentation — Google
- Schema.org vocabulary — schema.org
- SEO Starter Guide — Google Search Central
- MDN — HTML meta and link elements — Mozilla MDN