Introduction

Below are several examples that show how to associate multiple form elements, such as text-input fields or radio buttons, with a single label. Each has been tested with JAWS, NVDA and VoiceOver in combination with Internet Explorer, Firefox and Safari. The differences between the examples are evident when using a screen reader but are not necessarily evident visually. When testing these examples yourself, be sure to use multiple screen readers and browsers as results may vary from one combination to the next.

In these examples, each input element is coded as a child of its corresponding label element, a practice that is now permitted in HTML5. Here is a code sample:

<label>Area code
<input type="text" size="3">
</label>
<label>Seven-digit number
<input type="text" size="8">
</label>

This greatly simplifies form construction because it eliminates the need to use matching for and id attributes on each label and input. (Unique id attributes are still required when using aria-labelledby, or when linking fields with labels across table cells.)