Button (form)
Element of a form that allows you to perform a predefined action. For example, the submit button on a form sends the collected information to the server for processing. The accessible name of a button must describe the action resulting from its activation (for example: "Start your search", "Send your message").
In HTML, there are three types of form buttons:
- The
<input>tag of typesubmit,resetorbutton; - The
<input>tag, of typeimage; - The
<button>tag.
It is also possible to render a button using the WAI-ARIA button role.
The accessible name of a button can be of six types:
- The content of the passage of text associated with the button via the WAI-ARIA
aria-labelledbyattribute when it is present; - The value of the
aria-labelattribute when it is present; - The value of the
altattribute of animagetype button; - The value of the
valueattribute for buttons of typesubmit,resetorbutton; - The content of the
<button>tag; - The value of the
titleattribute when it is present.
Important note: when several of these techniques are present on the same button, the calculation of the "accessible name", i.e. what will be rendered, follows a strict order:
aria-labelledby;- otherwise
aria-label; - otherwise
altforimageinputs; - otherwise
valueforsubmit,resetorbuttoninput; - otherwise the content of the
<button>tag; - otherwise
title.
This order should be used to assess the relevance of the button's "accessible name". For example, even if there is a title and a passage of text referenced by aria-labelledby on the same button, it is the passage of text referenced by aria-labelledby that should be evaluated.
Reference: Accessible name and description calculation.
Furthermore, an "accessible name" will be considered irrelevant if it does not include the visible text of the button. For example: <button aria-label="confirm input">validate entry</button> will be considered as not conforming to critère 11.9.
Where this term is used
One accessibility criterion refers to this definition.