Understanding WCAG SC 2.5.3 Label in Name
Success Criterion 2.5.3 Label in Name (Level A): For user interface components with labels that include text or images of text, the name contains the text that is presented visually.
A best practice is to have the text of the label at the start of the name.
Imagine you are using the voice control feature in iPhone or Windows recognition software to see how they work. When you are trying to activate a link “Sign in” which you visibly see, the speech input software, software is not able to activate the link.
You might be wondering why and try to solve the mystery. The answer lies in the code where the visible link text says “Sign in” but the aria-label says “Log in”. Now, let us put ourselves int eh shoes of those who use a speech input users and understand how it would be frustrating if the speech input program is not able to activate user interface controls just because the visible label and the accessible name do not match.
This success criterion intends to bridge the gap between the visible label and the accessible name so that people with disabilities who use visible label can use the same label programmatically.