The Balai’s loudspeaker is a live region: set aria-live, role and aria-atomic, change the board with real DOM actions, and hear what reaches Mr. Sugeng as…
Why it matters
Toasts, validation errors, result counts, cart badges: they all change without a reload. Without a live region a screen reader user never learns that anything happened. Set it wrong and they drown in announcements or miss the one that matters.
The key idea
What gets announced is a change, not an element
Common mistakes
Using assertive for every notification Every update cuts off what the user is reading, which wears them out. Default to polite (or role="status"); keep assertive and role="alert" for urgent things: errors, a session about to end.
Creating the live region and its content at the same time The screen reader only announces changes in a region it already knows. Render the empty region in the HTML from the start and set its textContent later. If JS has to make it, insert it empty first and fill it on a later tick.
Updating too often (on every keystroke, say) Every polite update queues, so the screen reader keeps reading numbers that are already stale. Debounce the update and announce only the final summary ("2 results").
Only the number is read: "3" Without aria-atomic="true" the screen reader reads only the node that changed. Put aria-atomic="true" on the region (or use role="status") so the whole sentence is read.
Try it in this playground
Play the Toast situation to the end "Changes saved" joins the queue at second 1 but is read only after the paragraph ends. That is polite.
Switch aria-live to assertive and play again The paragraph is cut off mid-sentence. Right for an error, annoying for an ordinary toast.
Cart badge: set aria-atomic to true Without it the screen reader only says "3". With it: "3 items in your cart". role="status" is atomic by default too.
Insert a region that is already filled and hear the silence The MutationObserver sees the region come in, yet the screen reader says nothing. Switch to "there from the start" + "replace region text" and it gets read.