Fail

Buttons without text

The short version

Give each button text or an aria-label.

What it means

Some buttons have no accessible name: a <button> or an element with role="button" that has no text, no image with alt text, and no aria-label or aria-labelledby. Close buttons, menu toggles and play buttons drawn with icons are common examples.

Why it matters

Screen readers announce such a control as just "button", so people don't know what pressing it will do. Speech-control users can't name it to press it. WCAG 2 success criterion 4.1.2 asks every control to have a name.

How to fix it

  1. Put text inside the button: <button>Close</button>.
  2. For an icon button, add aria-label="Close", or visually hidden text inside it.
  3. If the icon is an image, give it alt text describing the action.
  4. Prefer a real <button> over a div with role="button": it also works with the keyboard.

Check it worked

Run the accessibility check again on the same address. The finding should be gone. Then try the page yourself with only the keyboard, and if you can, with a screen reader such as NVDA or VoiceOver: automated checks find only some problems.