Reputation: 2555
Does a button with a value really need a matching label tag in order to be 508 compliant?
Say I have:
<label for="search_box" class="hideme">search query</label>
<input type="text" id="search_box">
<input type="button" id="search" value="Search">
The web accessibility testing software is flagging it since it has an id but no matching label? Is it really necessary?
Upvotes: 1
Views: 3014
Reputation: 3392
A <label>
is not needed for <input type="button">
, you need to provide a value attribute. If the button is using an image versus text, you need to provide an alt to be compliant.
<input type="button" src="....jpg" alt="Search" id="...">
Upvotes: 3