CriticalWCAG 4.1.2 · Level A
button-nameButton has no accessible name
A button with only an icon and no text is announced as just “button”, so people can’t tell what it does. Give it a name with visible text, visually hidden text or an aria-label.
Who it hurts
Screen reader users and voice control users, who need a name to say (“click Cart”).
Icon-only buttons (cart, search, close, menu) are the most common case. Voice control users cannot activate a button they can’t name.
How to fix it
Pick your stack. Review every change before you ship it.
Before
<button><svg …></svg></button>After
<button aria-label="Open cart"><svg aria-hidden="true" …></svg></button>Check it by hand too
Tab to each button with a screen reader on. Each should be announced with a clear purpose, such as “Open cart, 2 items, button”.
Automated checks find a large share of accessibility problems, but not all of them. Passing this check does not on its own make a page compliant.
WCAG reference
- 4.1.2 Name, Role, Value (Level A). Understanding 4.1.2