--- url: "https://www.w3.org/WAI/WCAG22/Techniques/html/H44" titulek: "H44: Using label elements to associate text labels with form controls | WAI | W3C" h1: "Technique H44:Using label elements to associate text labels with form controls" popis: "" jazyk: "en" kanonicka: "" drobecky: [] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-14 03:50:02" znaku: 5764 slov: 776 kodovani: "utf-8" sha256: "f7a2fd71da158395f9f71033429adebadbd32beaf91159addcb645327d20294a" --- # Technique H44:Using label elements to associate text labels with form controls ## About this Technique This technique relates to: - [1.1.1 Non-text Content](https://www.w3.org/WAI/WCAG22/Understanding/non-text-content) ( **Sufficient** ) - [1.3.1 Info and Relationships](https://www.w3.org/WAI/WCAG22/Understanding/info-and-relationships) ( **Sufficient** when used for making information and relationships conveyed through presentation programmatically determinable) - [3.3.2 Labels or Instructions](https://www.w3.org/WAI/WCAG22/Understanding/labels-or-instructions) ( **Sufficient** ) - [4.1.2 Name, Role, Value](https://www.w3.org/WAI/WCAG22/Understanding/name-role-value) ( **Sufficient** when used with [G108: Using markup features to expose the name and role, allow user-settable properties to be directly set, and provide notification of changes](../general/G108) ) This technique applies to HTML controls that use external labels. Techniques are examples of ways to meet Web Content Accessibility Guidelines (WCAG). They are **not required** to meet WCAG. Content can satisfy the normative requirements of WCAG even if it does not use any of the documented techniques. See [About WCAG Techniques](https://www.w3.org/WAI/WCAG22/Techniques/about). ## Description The objective of this technique is to use the `label` element to explicitly associate a form control with a label. A `label` is attached to a specific form control through the use of the `for` attribute. The value of the `for` attribute must be the same as the value of the `id` attribute of the form control. The `id` attribute may have the same value as the `name` attribute, but both must be provided, and the `id` must be unique in the web page. This technique is sufficient for Success Criteria [1.1.1 (Non-Text Content)](https://www.w3.org/WAI/WCAG22/Understanding/non-text-content.html), [1.3.1 (Info and Relationships)](https://www.w3.org/WAI/WCAG22/Understanding/info-and-relationships.html) and [4.1.2 (Name, Role, Value)](https://www.w3.org/WAI/WCAG22/Understanding/name-role-value.html) whether or not the `label` element is visible. That is, it may be hidden using CSS. However, for Success Criterion [3.3.2 (Labels or Instructions)](https://www.w3.org/WAI/WCAG22/Understanding/labels-or-instructions.html), the `label` element must be visible since it provides assistance to all users who need help understanding the purpose of the field. An additional benefit of this technique is a larger clickable area for the control, since clicking on either the label or the control will activate the control. This can be helpful for users with impaired motor control. Note that the `label` is positioned after `input` elements of `type="checkbox"` and `type="radio"`. Note Elements that use explicitly associated labels are: - inputs for text entry: - `input type="date"` - `input type="datetime-local"` - `input type="email"` - `input type="month"` - `input type="number"` - `input type="password"` - `input type="search"` - `input type="tel"` - `input type="text"` - `input type="time"` - `input type="url"` - `input type="week"` - `input type="checkbox"` - `input type="color"` - `input type="file"` - `input type="radio"` - `input type="range"` - `select` - `textarea` The `label` element is **not** used for the following elements: - `button` (the label is provided by the content) - `input type="button"` (the label is provided by the content) - `input type="hidden"` - `input type="image"` (the label is provided by the `alt` attribute) - `input type="reset"` (the label is label provided by the `value` attribute) - `input type="submit"` (the label is label provided by the `value` attribute) ## Examples ### Example 1: A text input field The text field in this example has the explicit label of "First name:". The `label` element's `for` attribute matches the `id` attribute of the `input` element. ``` ``` ### Example 2: A checkbox ``` ``` ### Example 3: A group of radio buttons A small, related group of radio buttons with a clear description and labels for each individual element. ```

Doughnut Selection

Pick the doughnut you would like
``` ## Related Resources *No endorsement implied.* - [HTML - the `input` element](https://html.spec.whatwg.org/multipage/input.html#the-input-element) . - [HTML - the `label` element](https://html.spec.whatwg.org/multipage/forms.html#the-label-element) . ## Tests ### Procedure For all `input` elements of type `text`, `file` or `password`, for all `textarea` elements, and for all `select` elements in the web page: 1. Check that there is a `label` element that identifies the purpose of the control before the `input` , `textarea` , or `select` element 2. Check that the `for` attribute of the `label` element matches the `id` of the `input` , `textarea` , or `select` element. 3. Check that the `label` element is visible. For all `input` elements of type checkbox or radio in the web page: 1. Check that there is a `label` element that identifies the purpose of the control after the `input` element. 2. Check that the `for` attribute of the `label` element matches the `id` of the `input` element. 3. Check that the `label` element is visible. ### Expected Results - Checks #1 and #2 are true. - For Success Criterion 3.3.2 (Labels or Instructions), check #3 is also true. Back to Top