Web Accessibility at Iowa

Using label elements to associate text labels with form controls

Techniques

Explicit labels

Explicit labels are programmatically associated, one-to-one, with their respective form elements. Each form control has a unique ID, and this ID is referenced in the FOR attribute of the <label> tag

Example: User Information

<label for="user-first-name">First Name</label>
<input type="text" id="user-first-name" />

Implicit labels

Explicit labels are programmatically associated, one-to-one, with their respective form elements. Each form control has a unique ID, and this ID is referenced in the FOR attribute of the <label> tag

Example: User Information

<label>
User Name: <input type="text" id="user_name" size="40" />
</label>

View a form that uses explicit and implicit labels to identify form controls