Buttons must have an accessible name

Every button needs a text name that assistive technology can announce, so users know what it will do before they press it. Icon-only buttons are the most common cause of this issue.

Rule IDbutton-name
ImpactCritical
Success criterion 4.1.2 Name, Role, Value · A
StandardsWCAG 2.0 · WCAG 2.1 · WCAG 2.2 · Section 508 · EN 301 549
Readabler fix Fixed with a text: from the page or written by AI

Example

Before
<button type="button" class="cart-add">
  <svg viewBox="0 0 24 24"><path d="M3 3h2l3 12h11l2-8H6"/></svg>
</button>

A screen reader announces only “button”, so the user must guess what it does.

After
<button type="button" class="cart-add" aria-label="Add to cart">
  <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M3 3h2l3 12h11l2-8H6"/></svg>
</button>

A screen reader announces “Add to cart, button”.

Why it matters

Blind and low-vision people using screen readers hear buttons announced by their name and role. When the name is missing they hear only “button”, sometimes over and over on a product grid, and have to guess or press it to find out what happens. That guess might empty a cart or submit an order.

Speech recognition users are affected too: they activate controls by saying their name, such as “click Add to cart”. A button with no name cannot be targeted this way, so they fall back to slow workarounds like numbered grids.

A nameless button is a Level A failure, so it is one of the issues most often cited in accessibility complaints and audits.

How to fix it

Choose the technique by what the button contains.

Text button. Put the action in the button itself. This is the most robust option:

<button type="submit">Subscribe</button>

Icon-only button. Add aria-label with the action and hide the icon from screen readers:

<button type="button" aria-label="Close dialog">
  <svg aria-hidden="true" focusable="false">…</svg>
</button>

Button with an image. Give the image an alt that describes the action, not the picture:

<button type="button"><img src="search.svg" alt="Search"></button>

Visible text nearby. Point aria-labelledby at it, so the name always matches what users see:

<h3 id="p12">Linen sofa</h3>
<button type="button" aria-labelledby="fav p12" id="fav">Save</button>

Avoid relying on title alone: it is not shown to touch or keyboard users. Also check that text is not hidden with display: none or emptied by an icon font that replaces it with a glyph.

Checklist

  1. Give every button visible text when possible.
  2. Add aria-label to icon-only buttons.
  3. Describe the action, not the icon.
  4. Hide decorative icons with aria-hidden="true".

How the check works

The check looks at <button> elements and elements with role="button". It passes when the button has a name from its text content, an image alt, aria-label, aria-labelledby pointing to text, or a title. It fails when the computed name is empty. A manual review is still needed to confirm the name actually describes the action: “button” or “click” passes the check but helps nobody.

Resources

Updated October 27, 2026