Accy

Buttons with no name

WCAG 4.1.2 (A) · EN 301 549 9.4.1.2

Some buttons have no visible text and no accessible name.

Why it matters

This usually hits icon-only buttons: the close X, the search magnifier, the basket in the header. A screen reader announces them as "button" and the person has to activate them to find out what they do.

How to fix it

If the button has visible text, you are done. If it is icon-only, add an aria-label with the action and mark the icon aria-hidden="true".

As it is
<button><svg>…</svg></button>
As it should be
<button aria-label="Dismiss notice">
  <svg aria-hidden="true">…</svg>
</button>

On your platform

Related

Does your shop have this failure?

Check for free, along with the other 54 rules. No sign-up.

No sign-up. We scan one public page and store nothing about you.