Accessibility · Senior · Question 8 of 75

Why might an extra wrapper break this widget?

<div role="tablist">
  <div class="scroller">
    <button role="tab">One</button>
  </div>
</div>
Show the answer

Correct answer: tab must be owned by tablist, and a generic in between can break it

Explanation

Roles have required context. Assistive tech may not see the tabs correctly. Fix the DOM, or as a last resort use aria-owns.

Further reading

Problem with a question

Accessibility · Senior · question 8

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