Skip to content
Accessibility Scanner

How to fix

How to fix buttons with no accessible name

By · updated 2026-09-15

A button a screen reader announces as just "button" is a dead end. This is common with icon-only buttons. Here is how to give each one a name without changing your design.

Find buttons with no accessible name, free scan.

Why this fails

WCAG 4.1.2 Name, Role, Value requires every button to expose a name that says what it does. The usual failures are icon-only buttons, the hamburger menu, search, close (×), play, and similar, where the button contains only an icon or SVG with no text. Assistive technology then has nothing to announce.

What "buttons must have discernible text" means

The button has no accessible name, so a screen reader announces it as bare "button" with no indication of what it does. "Buttons must have discernible text" is axe-core's wording, which is what this scanner, Chrome DevTools and PageSpeed Insights all report, since Lighthouse's accessibility audits run axe-core.

"Discernible text" does not mean visible text. A name supplied by aria-label passes even though nothing is drawn on screen. The name is taken from the first of these that exists: aria-labelledby, then aria-label, then the button's text content (including the alt of an image inside it), then title, then value on an <input type="submit">.

The trap is an icon marked aria-hidden="true" inside a button with no other text. Hiding the icon is correct, but it removes the only thing that could have supplied a name, so the button ends up nameless. Add aria-label to the button whenever you hide its icon.

This is a genuine WCAG failure, not a best-practice warning: axe maps it to 4.1.2 Name, Role, Value at Level A.

How to fix it

The simplest fix, if it suits the design, is visible text inside the button. When the button must stay icon-only, give it an accessible name with aria-label and hide the icon from assistive tech:

<button aria-label="Open menu">
  <svg aria-hidden="true">...</svg>
</button>

An alternative is visually hidden text inside the button, which some teams prefer because it survives translation:

<button>
  <svg aria-hidden="true">...</svg>
  <span class="sr-only">Open menu</span>
</button>

If you are using a <div> or <span> as a button, switch it to a real <button> so it also gets the correct role and keyboard behaviour.

Finding the unnamed ones

Icon buttons usually come from a shared component, so one nameless hamburger often means the same fault on every page. The scan above lists each button with no accessible name and the element it found, which tells you whether you are fixing one template or twenty pages. Add the name, then scan again to confirm. The browser extension is quicker for checking a single page while you work.

Frequently asked questions

How do I name an icon-only button?

Add an aria-label describing the action ("Open menu", "Close", "Search"), and mark the icon aria-hidden="true" so it is not announced separately.

What is the difference between aria-label and visually hidden text?

Both give an accessible name. aria-label is simpler; visually hidden text is real DOM text, which can be more robust for translation. Either is fine.

Should I use a div as a button?

No. Use a real <button>. It comes with the correct role, keyboard support, and focus behaviour that a styled <div> does not.

Which WCAG criterion does this cover?

4.1.2 Name, Role, Value, which requires interactive elements to expose an accessible name and role.

Related guides

See what's actually broken on your site

Real axe-core results, every element outlined. No email wall, no fake “compliant” badge.

Run a free scan

Last updated 2026-09-15.