Accessibility fix guide
WCAG 4.1.2 Name, Role, Value
How to fix: Buttons must have an accessible name
Every button needs a discernible name. An icon-only button with no label is announced as “button”, so nobody using a screen reader knows what it does.
The fix
Ensure every button has a discernible label: visible text, aria-label, or aria-labelledby.
Before and after
Fails
<button><svg>…</svg></button>
Passes
<button aria-label="Close dialog"><svg aria-hidden="true">…</svg></button>
Related fixes
Does your site have this issue?
Scan any page free against WCAG 2.2 AA and get every issue with its fix.
Scan your site free