SIA-R12Buttons have an accessible name

Accessibility requirements

This rule tests conformance of the following accessibility requirements:

Description

This rule checks that buttons, such as <button> elements and <input> elements with a type=button, type=reset, or type=submit attribute, have an accessible name.

Applicability

This rule applies to every element in the HTML namespace with a semantic role of button where the element is included in the accessibility tree, except if the element is an <input> element with a type attribute in the Image Button state.

The specification of the type attribute describes in detail how to map the value of the attribute to its corresponding state.

Expectations

  1. The element has an accessible name that is not empty.

Assumptions

This rule makes no assumptions.

Accessibility support

This rule has no known accessibility support concerns.

Examples

Passed

These elements have a semantic role of button and an accessible name and therefore pass the rule:

<button>My button</button>
<span role="button" aria-label="My button"></span>
<button disabled>Delete</button>

Failed

This element has no accessible name and therefore fails the rule:

<button></button>

Inapplicable

This element does not have a semantic role of button and is therefore inapplicable:

<button role="link">take me somewhere</button>

Acknowledgments

This document includes material copied from or derived from https://act-rules.github.io/rules/97a4e1/. Copyright © 2021 W3C® (MIT, ERCIM, Keio, Beihang).