A webpage should make sense even when someone cannot see its colors, pictures, or layout.
What You Need to Know
A description adds useful instructions after the control's main name. aria-describedby links a field to a hint or error without making the full hint part of its name. IDs must point to the correct element.
Try the Example
Take a look at the example. We’ll explain the important lines right below it.
<label for="nickname">Nickname</label>
<input id="nickname" name="nickname" aria-describedby="nickname-hint">
<p id="nickname-hint">Choose a public name. Do not include personal information.</p>
Let’s Read the Code
- aria-describedby: Aria-describedby points to helpful explanatory text by its ID.
- <label>: The label tells people what the input is for. A matching for/id pair makes the label clickable.
- <input>: The input is a control. Its type changes the way people enter information.
- for: For connects a label or output with a control by ID.
Read the named elements and attributes together. They explain how the browser connects this feature to the rest of the page.
What Happens in the Browser?
Try this with Tab and Shift+Tab. If you can, inspect the accessibility tree too; appearance alone does not tell the whole story.
What does assistive technology receive? The example includes aria-describedby. These relationships can explain names, states, or descriptions when used correctly. They do not automatically move focus, listen for clicks, or create keyboard handling.
Your Turn
Move through the example without a mouse. Read each control name and current state aloud as if describing it to a friend.
Common Beginner Mistakes
- Expecting the page to run scripted behavior when the required JavaScript is missing.
- ARIA changes what assistive technology is told; it does not automatically add keyboard controls, visual styling, or JavaScript behavior.
Key Takeaways
- A description adds useful instructions after the control's main name.
- aria-describedby: Aria-describedby points to helpful explanatory text by its ID.
- A meaningful HTML element is usually a stronger starting point than adding an ARIA role to a generic div. Also check what happens using only the keyboard.