Elements with visible text labels have matching accessible names

A button or link's visible label matches what screen readers announce.

On this page

Impact

ScanGov impact ratings

About

Visible text labels that do not match the accessible name can result in a confusing experience for screen reader users.

Risks

Voice control users cannot activate elements by their visible label.

Why it's important

Improves the experience for assistive technology users by ensuring content structure is clear and consistent.

User stories

As an assistive technology user, I want content to be properly structured so that I can navigate and understand the page.

Code

Failing pattern:

<!-- Fail: aria-label does not include the visible button text -->
<button aria-label="Delete record">Remove</button>

Passing pattern:

<!-- Pass: accessible name starts with or contains the visible text -->
<button aria-label="Remove this record">Remove</button>

Error

ScanGov messaging when a site fails a standard:

Failed: Elements with visible text labels have matching accessible names

Guidance

Indicators

On this page