--- url: "https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA9" titulek: "ARIA9: Using aria-labelledby to concatenate a label from several text nodes | WAI | W3C" h1: "Technique ARIA9:Using aria-labelledby to concatenate a label from several text nodes" popis: "" jazyk: "en" kanonicka: "" drobecky: [] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-14 03:49:58" znaku: 9138 slov: 1341 kodovani: "utf-8" sha256: "91df04f316495a2a5b186e5da09938c5fa6d6b72cc35db46e9d995e8b9d04ba3" --- # Technique ARIA9:Using aria-labelledby to concatenate a label from several text nodes ## About this Technique This technique relates to: - [1.1.1 Non-text Content](https://www.w3.org/WAI/WCAG22/Understanding/non-text-content) ( **Sufficient** ) - [3.3.2 Labels or Instructions](https://www.w3.org/WAI/WCAG22/Understanding/labels-or-instructions) ( **Sufficient** when used with [G131: Providing descriptive labels](../general/G131) ) This technique applies to technologies that support [Accessible Rich Internet Applications (WAI-ARIA)](https://www.w3.org/TR/wai-aria/). 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 `aria-labelledby` property can be used to provide a name for all visual objects. Applied to inputs, the `aria-labelledby` property can be used to provide a name to native inputs as well as non-native elements, such as custom text inputs constructed with div contenteditable="true". One particular use of `aria-labelledby` is for text inputs in situations where a meaningful name should consist of more than one text string. Authors assign unique `id`s to the label strings to be concatenated as the name for the `input` element. The value of the `aria-labelledby` attribute is then a space-separated list of all `id`s in the order in which the label strings referenced should be read by screen readers. Supporting user agents will concatenate the label strings referenced and read them as one continuous name for the input. The concatenation of strings can be useful for different reasons. In example 1, an input is nested within the context of a full sentence. The desired screen reader output is "Extend time-out to [ 20 ] minutes - edit with autocomplete, selected 20". Since the `id` of the text input is included in the string of `id`s referenced by aria-labelledby, the value of the input is included in the concatenated name at the right position. Another application of `aria-labelledby` is when there is no space to provide a visible label next to the input, or when using native labels would create unnecessary redundancy. Here, the use `aria-labelledby` makes it possible to associate visible elements on the page as name for such inputs. This is demonstrated in example 2 where table column and row headings are concatenated into names for the text input elements inside the table. Note The [Accessible Name and Description Computation](https://www.w3.org/TR/html-aam-1.0/#accessible-name-and-description-computation) specifies that the string specified in `aria-labelledby` should replace rather than add to the content of the element that carries the property. So adding the `aria-labelledby` property to a native label should replace the text content inside that label unless the label itself is referenced as part of the sequence of `id`s in `aria-labelledby`. ## Examples ### Example 1: A time-out input field with concatenated name A text input allows users to extend the default time before a time-out occurs. The string "Extend time-out to" is contained in a native `label` element and is associated with the input with the input by id="timeout-duration" . This label is associated with this input using the for/id association only on user agents that don't support ARIA. On user agents that support ARIA, the for/id association is ignored and the name for the input is provided only by `aria-labelledby`, per the [Accessible Name and Description Computation](https://www.w3.org/TR/html-aam-1.0/#accessible-name-and-description-computation) in the HTML Accessibility API Mappings 1.0. The `aria-labelledby` attribute on the text input references three elements: (1) the `span` containing the native label, (2) the text input containing the default text '20' (recall that this input is not labelled with the for/id associated label text), and (3) the string 'minutes' contained in a `span`. These elements should be concatenated to provide the full name for the text input ```
minutes
``` Working example, [Time-out input field with concatenated label](../../working-examples/aria-labelledby-time-out-input-concatenated-label/), adapted from Easy ARIA tip #2: aria-labelledby and aria-describedby, an example put together by Marco Zehe. ### Example 2: A simple data table with text inputs A simple data table containing text inputs. The input labels are concatenated through `aria-labelledby` referencing the respective column and row headers. ```
Taxpayer Spouse
W2 Gross
Dividends
``` Working example, [Using aria-labelledby for simple table with text inputs](../../working-examples/aria-labelledby-table-text-inputs/), based on an example by Jim Thatcher. ### Example 3: A conference workshop booking table A conference workshop booking table with two parallel tracks allows users to select the workshop they want to attend. When tabbing through the checkbox inputs in the table, the track (1 or 2), the title, and the speaker of the workshop followed by the adjacent checkbox label "Attend" are provided as concatenated name for the checkboxes via `aria-labelledby`. ```

Dinosaur Conference workshops timetable Thursday, 14 & Friday, 15 March 2013

Dinosaur Conference workshop booking table
Track Thursday Friday
9 to 12 AM 2 to 5 PM 9 to 12 AM 2 to 5 PM
Track 1

The Paleozoic era

2 places left

The Mesozoic era overview

2 places left

The Triassic period, rise of the dinosaurs

1 place left

The Jurassic period

11 places left

Track 2

The Cretaceous period

18 places left

The end of the dinosaurs

2 places left

First discoveries of dinosaurs

2 places left

Emerging scholarship

19 places left

``` Working example: [Conference workshop booking timetable](../../working-examples/aria-labelledby-workshop-booking-timetable/). ## Related Resources *No endorsement implied.* - [HTML Accessibility API Mappings](https://www.w3.org/TR/html-aam/) - [WAI-ARIA Authoring Practices Guide](https://www.w3.org/WAI/ARIA/apg/) - [Using ARIA](https://www.w3.org/TR/aria-in-html/) : Practical Support: aria-label, aria-labelledby and aria-describedby ## Tests ### Procedure For inputs that use `aria-labelledby`: 1. Check that `id` s referenced in `aria-labelledby` are unique and match the `id` s of the text nodes that together provide the label 2. Check that the concatenated content of elements referenced by `aria-labelledby` is descriptive for the purpose or function of the element labeled ### Expected Results - #1 and #2 are true. If this is a sufficient technique for a success criterion, failing this test procedure does not necessarily mean that the success criterion has not been satisfied in some other way, only that this technique has not been successfully implemented and can not be used to claim conformance. Back to Top