Label in name

The words visible on a control also appear in its accessible name, so voice-control users can activate what they see.

voice control cannot click the buttonbutton says save but screen reader says submitsay what you see to click itI said click search and nothing happenedthe aria label does not match the words on the buttonwhy does saying the button name not workspeech control button nameslable in name

See it

Live demo coming soon

What it is

Label in name means the words printed on a control also occur in its accessible name. If a button visibly says 'Search' and its accessible name is 'Search products', it works. If the name is 'Find products', a person using Apple Voice Control may say 'Click Search' and fail because the software is matching speech against a different name.

WCAG 2.5.3 applies to controls whose visible label contains text or an image of text. The safest pattern is to let the visible text supply the name directly. Extra context can follow it, so repeated 'Edit' buttons can become 'Edit billing address' while still containing the word the user sees.

Gotcha: aria-label wins over a button's inner text in the accessible name computation. Adding aria-label='Submit order' to a visible 'Buy now' button silently creates the mismatch. Remove the override, or use aria-labelledby to combine the visible label with extra on-page context.

Ask AI for it

Audit every labeled control against WCAG 2.5.3 Label in Name. In Chrome DevTools, compare each visible label with the computed accessible name and make the visible words appear in the same order, preferably at the start of the name. Remove aria-label values that replace button text or form labels with different wording. When repeated controls need context, use aria-labelledby to combine the visible label with the relevant item name, producing names such as 'Edit billing address'. Test the final controls with Apple Voice Control commands that use the exact words on screen, and return a table of visible label, old name, and corrected name.

You might have meant

accessible namearia labelvoice controlform label associationscreen reader