aria-live: Announcing Dynamic Changes
What you'll learn: How to make screen readers automatically announce when content on your page changes, without the user having to navigate to it.
The Problem with Dynamic Content
Imagine you're listening to a radio show while cooking. If someone changes the recipe on your counter without telling you, you'd never know—unless they announce it. That's exactly what happens with dynamic content updates for screen reader users. When JavaScript changes content on the page (like loading new messages, showing errors, or updating a cart total), sighted users see it immediately, but screen reader users might miss it entirely unless their focus happens to be on that element.
What is aria-live?
The aria-live attribute creates a "live region" that tells screen readers to announce content changes automatically. You apply it to the container element where dynamic updates will happen.
Three politeness levels:
aria-live="off"— No announcements (the default)aria-live="polite"— Announces when the user pauses (most common)aria-live="assertive"— Interrupts immediately (use sparingly for critical alerts)
When to Use Each Level
Use polite for status messages, form validation feedback, or search results loading. Use assertive only for urgent information like "Your session will expire in 30 seconds."
<!-- Status message that updates dynamically -->
<div aria-live="polite" id="status-message">
Saving...
</div>
<!-- Critical alert -->
<div aria-live="assertive" role="alert">
Error: Payment failed
</div>
The live region must exist in the DOM before content changes. Only changes to its text or descendants will be announced—not the initial content.
Key Takeaway: Use aria-live="polite" to make screen readers announce dynamic content changes courteously, and aria-live="assertive" only for urgent, time-sensitive information that requires immediate attention.