CKTIS / HTML
aria-describedby — supplementary control description
`aria-describedby` connects an element to an explanation that supplements its accessible name.
Version: WAI-ARIA 1.2
Syntax
<input aria-describedby="hint limit">Supply identifiers of existing elements separated by spaces. Their text forms the description in reference order. Keep the control’s own name short and clear; the explanation can state a format, limit, or hint.
It neither replaces the label nor establishes validation rules. Rich description structure is flattened into text, so do not treat this as navigation through an interactive help panel. Additional information should also remain available visually.
The example field has the native label Project code and two explanations. The accessibility-tree test verifies a separate name and joined description. Maximum 8 characters does not enforce a length limit: implement that constraint separately.
Examples
<!doctype html><meta charset="utf-8">
<label for="code">Project code</label><input id="code" aria-describedby="hint limit">
<p id="hint">Use letters.</p><p id="limit">Maximum 8 characters.</p>
<output id="result"></output>
<script>
const input = document.querySelector('#code');
input.focus();
document.querySelector('#result').textContent = 'label=' + input.labels[0].textContent + '; description=' + input.getAttribute('aria-describedby').split(' ').map(id => document.getElementById(id).textContent).join(' ');
</script>Result
label=Project code; description=Use letters. Maximum 8 characters.
Verified the computed description and field name, not merely identifier presence in HTML.