CKTIS / HTML
aria-labelledby — a name from existing elements
`aria-labelledby` constructs an accessible name from the text of elements referenced by identifiers.
Version: WAI-ARIA 1.2
Syntax
<button aria-labelledby="verb topic">Download</button>Identifiers are separated by spaces, and reference order determines the order of name fragments. Use stable unique identifiers and actual labels rather than unrelated long content.
A valid reference takes precedence over aria-label. It replaces neither an additional description nor native-label behavior: clicking referenced text does not automatically focus an input. For ordinary fields prefer the native label–control relationship.
In the example report appears earlier in the DOM, but the reference list builds Download report. The accessibility-tree test confirms that order and excludes the fallback name Fallback. Changing page layout does not require changing the name order.
Examples
<!doctype html><meta charset="utf-8">
<span id="topic">report</span>
<button id="download" aria-label="Fallback" aria-labelledby="verb topic"><span id="verb">Download</span></button>
<output id="result"></output>
<script>
document.querySelector('#result').textContent = 'referenceOrder=' + document.querySelector('#download').getAttribute('aria-labelledby').split(' ').map(id => document.getElementById(id).textContent).join(' ');
</script>Result
referenceOrder=Download report
Verified the computed name, reference order, and precedence over the textual label.