Accessibility · Middle · Question 15 of 75
Why doesn't injecting a new element with role="alert" always get announced?
- 1Live regions are most reliable when they exist before changing
- 2Screen readers announce alerts only after a page reload
- 3The
alertrole only works inside a<dialog>element
Show the answer
Correct answer: Live regions are most reliable when they exist before changing
Explanation
Assistive tech has to register the region first. Keep an empty container in the DOM and update its text.