Skip to main content
Accessibility Checker

WCAG 4.1.2 Name, Role, Value

Buttons without names: label every icon button

A hamburger menu, a close "X" on a popup, a cart icon, the arrows on a slider: they look obvious on screen, but in code they are often buttons with nothing inside except an icon. A screen reader announces "button" and the visitor has to press it to find out what it does.

WCAG level
A
Who it affects
Screen reader and voice control users
Automated rule
button-name

What WCAG asks for

Criterion 4.1.2 Name, Role, Value requires every user interface control to have a name that assistive technology can read. For a <button> the name comes from the text inside it, from aria-label, or from aria-labelledby.

Voice control users depend on it too: they activate a button by saying its name, like "click Menu". A button with no name has nothing to say.

The usual suspects

  • Mobile menu toggles (the three lines icon)
  • Close buttons on popups, cookie banners and chat widgets
  • Slider arrows and dots
  • Search, cart and account icons in the header
  • Quantity steppers on product pages (the "+" and "-" buttons)
  • Play buttons on embedded videos

How to fix it

Add text the screen reader can read. Keep the icon hidden from it, so it is not read twice:

<!-- Visible text next to the icon -->
<button type="button" aria-expanded="false" aria-controls="menu">
    <svg aria-hidden="true" focusable="false"> ... </svg>
    Menu
</button>

<!-- Icon only: aria-label -->
<button type="button" aria-label="Close">
    <svg aria-hidden="true" focusable="false"> ... </svg>
</button>

<!-- Icon only: visually hidden text works the same way -->
<button type="button">
    <span aria-hidden="true">+</span>
    <span class="sr-only">Increase quantity</span>
</button>

Name the action, not the icon: "Close", not "X". "Add to cart", not "Cart icon". For a group of similar buttons, include what they act on: "Remove Navy wool coat from cart".

Use real buttons

Many unnamed controls are not buttons at all, but a <div> or <span> with a click handler. Those are invisible to the keyboard as well. Use <button type="button"> for actions and <a href> for navigation. A native button gets keyboard focus, Enter and Space support and the right role for free.

Toggle buttons need state too

A menu or accordion button should say whether it is open. Add aria-expanded="true" or "false" and update it when the state changes. Keep the name the same; the state attribute tells the rest.

What automated checks miss

Checks find buttons without a name and many fake buttons. They can not tell whether a name is accurate, whether focus moves into a popup when it opens and back when it closes, or whether the Escape key closes it. That is keyboard testing, done by a person.

Last updated October 18, 2026.

Free check

Does your site have this issue?

Run a free automated check of your home page. We test it against WCAG 2.2 AA on desktop and mobile and email you the results, with every issue sorted by severity.

FAQ

Questions

What does "buttons must have discernible text" mean?

The button has no accessible name: no text inside, no aria-label and no aria-labelledby. Screen readers announce only "button".

Is aria-label or hidden text better?

Both work for screen readers. Visible text helps everyone, including voice control users, so use it when there is room.

Does the button name have to match the visible text?

If the button shows text, the accessible name should contain that text (WCAG 2.5.3), so voice control users can say what they see.