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:

  1. Add title to the field.
  2. 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>

Warning

The 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" />

Find out more

Comments

Add a comment

Required fields are marked *.

Back to top