Axe rule guides
button-namecritical

Fix button-name axe errors

A button has no accessible name, so assistive technology users cannot tell what action it performs.

Affected users

Screen reader users, speech-input users, and keyboard users navigating by controls.

WCAG mapping

4.1.2 Name, Role, Value (A)

Detection

wcagc detects buttons without a computed accessible name and reports the failing element.

Failing markup

<button><svg aria-hidden="true"></svg></button>

Fixed code

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

Sources and standards

FAQ

Do icon-only buttons need text?

They need an accessible name. Use visible text when possible, or aria-label for compact icon-only controls.

Should I hide visible text with aria-label?

Avoid replacing clear visible text. If a button has visible text, make sure the accessible name includes that text.

Scan the rest of the page

One rule rarely travels alone

Run a page through wcagc to find this rule, related WCAG issues, affected selectors, and manual checks that automation cannot judge.

Scan a page