Accessibility · Middle · Question 30 of 75

Which attributes does a custom modal need?

Show the answer

Correct answer: role="dialog", aria-modal="true" and an accessible name

Explanation

aria-labelledby usually points to the title. Native <dialog> with showModal() handles most of the rest for you.

Further reading

Problem with a question

Accessibility · Middle · question 30

Test yourself

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

Take this quiz