Buttons must have discernible text
How to fix the button-name accessibility rule. Names of links, buttons and controls.
What this rule checks
Ensure buttons have discernible text
Who is affected
Screen readers announce this as just "button", so users don't know what it does. Common with icon buttons.
How to fix it
Put text inside the button, or add an aria-label for icon-only buttons.
Example
Before
<button><svg>…</svg></button>After
<button aria-label="Close menu"><svg aria-hidden="true">…</svg></button>WCAG success criteria
When this rule fails, the page fails:
- 4.1.2 Name, Role, Value (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 button-name (the makers of axe-core, the engine our scanner uses)
- All fix guides