button, link, and menuitem elements have accessible names

Buttons, links, and menu items have labels that screen readers can announce.

On this page

Impact

ScanGov impact ratings

About

When an element doesn't have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. [Learn how to make command elements more accessible](https://dequeuniversity.com/rules/axe/4.10/aria-command-name).

Risks

Screen readers announce buttons and links without names, hiding their purpose.

Why it's important

Ensures assistive technologies like screen readers can correctly interpret and announce page elements to users with disabilities.

User stories

As a screen reader user, I want ARIA attributes to be correctly implemented so that I can understand the purpose and state of interactive elements.

Code

Failing pattern:

<!-- Fail: menuitem with no accessible name -->
<li role="menuitem"></li>

Passing pattern:

<!-- Pass: menuitem contains visible text -->
<li role="menuitem">Print</li>

Error

ScanGov messaging when a site fails a standard:

Failed: button, link, and menuitem elements have accessible names

Guidance

Indicators

On this page