CHOOSE ANY STEP
FREECODECAMP / HTML / STEP 6 OF 7
freeCodeCamp: Build an Accessible Audio Controller, Step 6
Connect the slider to its accessible name
Written guidance is free. Step videos are a member benefit.
Find the input element inside the div element. Keep its existing range attributes.
ORIGINAL WALKTHROUGH · 1:40
Watch with Rob.
Watch the explanation, then apply the change and run the official checks on freeCodeCamp.
You are signed in, but video access needs attention. Check your account access. Your saved work is kept.
Video walkthroughs are included with an active Code Zone membership. The written lesson and practice are free.
Your goals for this step
- Complete step 6: Connect the slider to its accessible name.
- The aria-labelledby attribute contains space-separated element IDs.
- Compare the browser result with the requirement before running the official checks.
THE TASK
What step 6 asks you to do
- Find the input element inside the div element. Keep its existing range attributes.
- Add aria-labelledby to the opening input tag.
- Inside one quoted value, reference volume-label and volume-description, separated by one space. Do not add hash signs.
- Match both referenced IDs to the actual span IDs.
Based on the official freeCodeCamp step 6 instructions (opens in a new tab).
Why this works
The aria-labelledby attribute contains space-separated element IDs. The browser finds both spans and combines their text into the input’s accessible name. Both strings contribute to its name here; volume-description is an ID, not a separate accessible-description attribute.
What you should see in the preview
The visible page looks the same. In the browser’s accessibility tree, the input has the slider role and the accessible name Volume Adjust the sound level. No separate description was added.
Illustrative browser result. External embeds, navigation and form submission are disabled here. Open freeCodeCamp to test the real behavior. Drag the lower-right corner to make this preview taller.
Terms to know
- aria-labelledby: Accessible name from other elements
- Contains space-separated IDs of elements whose text supplies this control’s accessible name. Both referenced texts contribute to the name in this exercise; this is not aria-describedby.
- id: ID attribute
- Identifies one element in a document. Keep each ID unique and match the required spelling.
- span: Span element
- Wraps a small piece of inline content. Separate spans do not create separate paragraphs.
- range: Range input
- A native slider for choosing a value between a minimum and maximum. It supports pointer and keyboard input.
If your check does not pass
- Check that the new element is inside the exact parent named in the task.
- Compare required text, attribute names and quoted values letter by letter.
- Preserve the earlier elements, then run the checks on freeCodeCamp.
Use the preview to inspect the structure, then run the checks on freeCodeCamp. Watching here does not submit code or mark an official step complete.
Know where to find it
You do not have to memorize every element or CSS property. Keep useful references nearby:
- MDN: aria-labelledby (opens in a new tab)
See how multiple ID references contribute to the accessible name.
- W3Schools: accessibility (opens in a new tab)
Compare the syntax and a focused example.
- W3Schools: id (opens in a new tab)
Compare the syntax and a focused example.
- W3Schools: blocks (opens in a new tab)
Compare the syntax and a focused example.
- MDN: HTML element reference (opens in a new tab)
Look up the definition, syntax and supported behavior.
What you have accomplished
The change for “Connect the slider to its accessible name” is ready to try. Return to freeCodeCamp, compare your result with the requirements, and run its checks. Your official progress stays there.
Independent guidance from The Code Zone, not affiliated with or endorsed by freeCodeCamp. Complete official work and certification requirements on freeCodeCamp. Curriculum checked November 16, 2026. Curriculum source (opens in a new tab).