7.2. Use the
title attribute to label form fields that don’t have a visible label
To label form fields that don’t have a visible label:
titleto the field.
- Populate the attribute by specifying the field’s function.
<input type="search" title="Your search" name="recherche" /> <input type="submit" value="Search" />
<select aria-label="Filter news" name="filter"> <option>By Date</option> <option>By Topic</option> […] </select>
placeholder attribute cannot be used as a label because it disappears during text entry.
It should only be used for secondary text entry aids that are not essential for understanding the field.
<input type="search" aria-label="Your search" placeholder="Enter keywords" />