2.5.3 Label in Name
A control's accessible name contains the text of its visible label.
Level A
What the automated checks look for
Controls' accessible names leave out their visible labels
The name a control is given doesn't contain its visible text, so speech-input users who say what they see can't activate it.
Who it affects. People using voice control say the words they see, "click Search", and nothing happens because the control's name is something else.
How to fix it. Make the accessible name start with the visible text, or remove the aria-label so the visible text is the name.
<button aria-label="Search invoices">Search</button>
<!-- not aria-label="Go" on a button that shows "Search" -->Read more
- Understanding 2.5.3, from the W3C
- Accessible components, with code to copy, our guide to building dialogs, menus and forms that meet it
- Read and write an accessibility conformance report, our guide to how a criterion’s row is set
- Previous: 2.5.2 Pointer Cancellation
- Next: 2.5.4 Motion Actuation