Accessibility · Senior · Question 10 of 75

Why does aria-labelledby fail across a Shadow DOM boundary?

Show the answer

Correct answer: ID references resolve only within one tree scope

Explanation

An id in the light DOM isn't visible from within a shadow root. Workarounds are keeping label and input together or using element reference APIs where supported.

Further reading

Problem with a question

Accessibility · Senior · question 10

Test yourself

Take the Accessibility · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz