Dieser Inhalt ist derzeit nur auf Englisch verfügbar
Audit aria-command-name
Ensure every ARIA button, link and menuitem has an accessible name
Impact:
Serious
WCAG-Konformität:
A
WCAG 4.1.2
Issue types:
failure, needs review
Button has non-empty accessible name
This rule checks that each `button` element has a non-empty accessible name.
Content loading...
Autoren: Stein Erik Skotkjerra, Wilco Fiers
Finanzierung: WAI-Tools
Applicability
This rule applies to elements that are included in the accessibility tree and have a semantic role of button, except for input elements with a typeattribute value of image.
Expectation
Each target element has an accessible name that is not empty ("").
Background
This rule considers an exception for "image buttons" (i.e., input elements with a typeattribute value of image). Image buttons failing this rule would fail Success Criterion 4.1.2 and Success Criterion 1.1.1 which is not part of the accessibility requirements for this rule.
Implementation of Presentational Roles Conflict Resolution varies from one browser or assistive technology to another. Depending on this, some elements can have a semantic role of button and fail this rule with some technology but users of other technologies would not experience any accessibility issue.
Some elements have a role of button and a default accessible name defined by the HTML Accessibility API Mapping, for example input elements whose typeattribute value is either submit or reset. This rule considers that these default names can be descriptive and therefore does not fail them.
This input element has an accessible name because of the default accessible name for an input element with a type attribute set to reset.
<inputtype="reset" />
Failed
Failed Example 1
This button element has no accessible name because it has no content or attribute that can provide it.
<button></button>
Failed Example 2
This button element has no accessible name. The value attribute does not provide an accessible name for button elements, only when an input element's state of the type attribute is button, submit or reset.
<buttontype="button"value="read more"></button>
Failed Example 3
This element with the button role has no accessible name because it has no content or attribute that can provide it.
<spanrole="button"></span>
Failed Example 4
This off screen button element has no accessible name because it has no content or attribute that can provide it.
This button element has an explicit role of none. However, it is focusable (by default). Thus it has a semantic role of button due to Presentational Roles Conflict Resolution. It has an empty accessible name.