Accessible name for buttons
Last updated:
How to define an accessible name for a button?
The following <button> elements have a valid name that can be announced by screen readers:
<button aria-label="Button name"></button>
<!-- or -->
<button aria-labelledby="name-for-button"></button>
<p id="name-for-button">Name for button</p>
<!-- or -->
<button title="Button name"></button>
<!-- or -->
<button>Button name</button>
Why is this important?
Screen readers announce the button with their accessible name. This way, people who use a screen reader hear the purpose of the button.
This rule fails often because icons are used as buttons. However, there is no way a screen reader can describe the icon deterministically.
More info:
Rule info
Standard
WCAG A SC 4.1.2
Regulations
User impact
Critical impact Prevents users with disabilities from accessing content entirely. Must be fixed. Critical : blocks access entirely Serious : significantly hinders use Moderate : causes difficulty Minor : minimal disruptionFix complexity
Medium level of technical expertise required To resolve this issue, you might need some technical background. It is possible to fix this issue without needing a software developer. This depends on the Content Management System (CMS) that your website is built with.Affects
Visual People with vision related disabilities can include those with color blindness, low vision, or complete blindness. Providing alternative text (also known as alt text) for graphical content is especially important for these individuals, as it allows assistive technologies such as screen readers to describe the content to them.
Free Website Accessibility Audit
Was this article helpful?
Thanks for your feedback!