How to fix: custom buttons or menu items without a name
WCAG 2.2 success criterion 4.1.2 (level A)
Why it matters
Elements with role="button", "link" or "menuitem" are announced without a name.
How to fix
Give them visible text, aria-label or aria-labelledby.
<div role="button" tabindex="0" aria-label="Open filter">…</div>
Test it yourself
- Find elements with role="button", "link" or "menuitem" that are not real buttons or links, and check each has text or an aria-label.
Common mistakes
- A <div role="button"> with only an icon inside.
- Menu items built from <span> elements with role="menuitem" but no text.
Check your own site
Find this and other problems on your website in 30 seconds, free.