Input buttons must have discernible text
How to Fix the Problem
Correct markup solutions
Eleven markup patterns pass the input-button-name
test
criteria:
<form action="#">
<input type="button" id="pass1" value="Button Name" />
<input type="button" id="pass2" aria-label="Name" />
<input type="button" id="pass3" aria-labelledby="labeldiv" />
<input type="button" id="pass4" value="Name" aria-label="Aria Name" />
<input type="submit" id="pass5" />
<input type="submit" value="Something" id="pass6" />
<input type="reset" id="pass7" />
<input type="reset" value="Something" id="pass8" />
<input type="button" title="Something" id="pass9" />
<input type="submit" title="Something" id="pass10" />
<input type="reset" title="Something" id="pass11" />
</form>
Incorrect markup solutions
Five markup patterns fail the input-button-name
test criteria:
<form action="#">
<input type="button" id="fail1" />
</form>
<form action="#">
<input type="button" id="fail2" aria-label="" />
</form>
<form action="#">
<input type="button" id="fail3" aria-labelledby="nonexistent" />
</form>
<form action="#">
<input type="button" id="fail4" aria-labelledby="emptydiv" />
<div id="labeldiv">Button label</div>
<div id="emptydiv"></div>
</form>
<form action="#">
<input type="submit" value="" id="fail5" />
</form>
<form action="#">
<input type="reset" value="" id="fail6" />
</form>
Why it Matters
Screen reader users are not able to discern the purpose of an
input type="button"
without an accessible name.
Screen reader users cannot understand the purpose of an image without a discernable and accessible textual name. A title for an image may provide only advisory information about the image itself. Unnamed actionable graphic images such as buttons have 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
Ensures input buttons have discernible text.
The input-button-name
rule separates functionality from the
button-name
rule to ensure that input buttons have discernible
text; advise relevant to input button names was incorrect for button elements.
The Algorithm (in simple terms)
Input buttons must have discernible text.