Buttons must have discernible text

Rule ID: button-name
Ruleset: axe-core 3.1
User Impact: Critical
WCAG: 4.1.2

Join our beta testing program!

We're looking for axe-users and front-end web developers to participate in testing some new accessibility tools.

Compliance Data & Impact

User Impact

Disabilities Affected

  • Blindness
  • Deafblindness

Requirement(s)

  • WCAG 2.1 (A): MUST
  • WCAG 2.0 (A): MUST
  • Section 508: MUST

WCAG Success Criteria

  • 4.1.2 Name, Role, Value

Section 508 Guidelines

  • 1194.22 (a) Text equivalent for non-text elements

How to Fix the Problem

Ensure that each button element and elements with role="button" have one of the following characteristics:

  • Inner text that is discernible to screen reader users.
  • Non-empty aria-label attribute.
  • aria-labelledby pointing to element with text which is discernible to screen reader users (i.e. not display: none; or aria-hidden="true".
  • role="presentation" or role="none" (ARIA 1.1) and is not in tab order (tabindex="-1").

Ensure that <input type="button">s have one of the following characteristics:

  • Non-empty value attribute.
  • Non-empty aria-label attribute.
  • aria-labelledby pointing to element with text which is discernible to screen reader users (i.e. not display: none; or aria-hidden="true".

Ensure that <input type="submit">, <input type="reset"> have one of the following characteristics:

  • Non-empty aria-label attribute.
  • aria-labelledby pointing to element with text which is discernible to screen reader users (i.e. not display: none; or aria-hidden="true".
  • Non-empty or unspecified value attribute. Browsers will give reset and submit buttons a default value so long as the value attribute is not specified.

Why this is Important

Screen reader users are not able to discern the purpose of button that has no accessible name.

Without a discernable, accessible textual name, there is no way to describe to screen reader users the purpose of an image used as a button. A title for an image may only provide advisory information about the image itself. In the case of actionable graphic images such as buttons, when there is no name, there is no clear description of the destination, purpose, function or action for the non-text content when it is intended to be used as a control.

Rule Description

Buttons must have discernible text that clearly describes the destination, purpose, function, or action for screen reader users.

The Algorithm (in simple terms)

Checks all buttons to ensure that they have a discernable, accessible name.

Resources

Refer to the complete list of axe 3.1 rules.