Skip to content

QuizNot attempted

Announcing a toast

A script shows "Saved!" in a toast. Sighted users see it; screen-reader users hear nothing. Fix?
1–4 to choose, Enter to submit
Show answer & explanation

Correct answer:

  • Render toasts inside a container with aria-live="polite" (or role="status") that exists before the message is inserted
  • A live region (aria-live="polite" or role="status") makes screen readers announce content changes inside it, and it must already exist in the DOM before the text is inserted or the change isn't noticed.
  • Not focusing the toast: steals focus and disrupts what the user was doing.
  • Not alert(): blocks the page and is a jarring modal for a success message.
  • Not aria-hidden=false: a no-op, the toast was never hidden from the a11y tree, it just wasn't announced.