Live Regions aria-live aria-atomic aria-relevant
Announce asynchronous updates to assistive technology.
Live Regions aria-live aria-atomic aria-relevant is a free HTML Academy lesson on CoddyKit — lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the HTML Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
What Are Live Regions?
A live region is a section of the page whose content updates dynamically. Screen readers monitor live regions and announce changes automatically without the user moving focus.
Creating a Live Region
Add aria-live to a container element:
<!-- Polite: announce when user is idle -->
<div aria-live="polite" id="notifications"></div>
<!-- Inject text to announce: -->
<script>
document.getElementById('notifications').textContent = '5 new messages';
// Screen reader announces: '5 new messages' when user pauses
</script>aria-live Values Recap
The three levels of aria-live:
off— no announcements (default for non-live regions)polite— announce when the user pauses speakingassertive— announce immediately, interrupt current speech
aria-atomic in Depth
aria-atomic controls what is announced when content changes:
<div aria-live="polite" aria-atomic="false"> <!-- default -->
Items in cart: <span id="count">3</span>
</div>
<!-- Only the changed span is announced: '4' -->
<div aria-live="polite" aria-atomic="true">
Items in cart: <span id="count">3</span>
</div>
<!-- The entire div is announced: 'Items in cart: 4' -->
<!-- aria-atomic="true" gives more context but is more verbose -->aria-relevant Values
aria-relevant specifies which DOM changes trigger announcements:
<!-- Default: additions text -->
<div aria-live="polite" aria-relevant="additions text">
<!-- Announce removals too: -->
<div aria-live="polite" aria-relevant="removals">
<!-- Announce everything: -->
<div aria-live="polite" aria-relevant="all">
<!-- Values: additions, removals, text, all
'additions' = added nodes announced
'removals' = removed nodes announced
'text' = text content changes announced -->Predefined Live Region Roles
Some roles implicitly set aria-live:
role="alert"— aria-live="assertive" + aria-atomic="true"role="status"— aria-live="polite" + aria-atomic="true"role="log"— aria-live="polite"role="timer"— aria-live="off"role="marquee"— aria-live="off"
Loading State with Live Region
Announce loading and completion states:
<div role="status" aria-live="polite" aria-atomic="true" id="load-status">
<!-- empty initially -->
</div>
<script>
async function loadData() {
document.getElementById('load-status').textContent = 'Loading...';
const data = await fetchData();
renderResults(data);
document.getElementById('load-status').textContent =
`${data.length} results loaded.`;
}
</script>Form Submission Feedback
Live region for form submission status:
<form id="contact-form" novalidate>
<input type="email" name="email">
<button type="submit">Subscribe</button>
</form>
<div role="status" aria-live="polite" id="form-status"></div>
<script>
form.addEventListener('submit', async (e) => {
e.preventDefault();
const status = document.getElementById('form-status');
status.textContent = 'Submitting...';
await submitForm(new FormData(form));
status.textContent = 'Thank you! You are now subscribed.';
});
</script>Search Results Count
Announce search results dynamically:
<label for="search">Search</label>
<input type="search" id="search">
<div role="status" aria-live="polite" aria-atomic="true" id="results-count"></div>
<div id="results"></div>
<script>
let debounceTimer;
search.addEventListener('input', () => {
clearTimeout(debounceTimer);
debounceTimer = setTimeout(() => {
const results = filterResults(search.value);
renderResults(results);
document.getElementById('results-count').textContent =
`${results.length} results for "${search.value}"`;
}, 300);
});
</script>Live Region Anti-patterns
Avoid these live region mistakes:
- Do not create and destroy live regions — make them persistent with empty initial content
- Do not put live regions inside aria-hidden areas
- Do not use assertive for routine updates — it is very disruptive
- Do not announce updates too frequently (throttle search result counts)
Testing Live Regions
How to test live region announcements:
- Turn on VoiceOver (Mac: Cmd+F5) or NVDA (Windows: Ctrl+Alt+N)
- Trigger the update and listen for the announcement
- Verify timing: polite waits, assertive interrupts
- Check axe DevTools doesn't flag live region issues
Quick Check
What role implicitly sets aria-live assertive and aria-atomic true?
Recap: Live Regions
Live region essentials:
aria-live="polite"— wait for user pausearia-live="assertive"— interrupt immediatelyaria-atomic="true"— announce whole regionrole="alert"= assertive + atomic; role="status" = polite + atomic- Keep live regions persistent; clear then set content
Frequently asked questions
Is the “Live Regions aria-live aria-atomic aria-relevant” lesson free?
Yes — the full text of “Live Regions aria-live aria-atomic aria-relevant” is free to read here on the web, and the HTML Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the HTML Academy course, upgrade to CoddyKit PRO.
What will I learn in “Live Regions aria-live aria-atomic aria-relevant”?
Announce asynchronous updates to assistive technology. You practise HTML Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start HTML Academy?
No prior experience is required. HTML Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Live Regions aria-live aria-atomic aria-relevant” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this HTML Academy lesson?
Yes. Every HTML Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- aria-expanded aria-controls for Toggles
- aria-selected and Tab Patterns
- Live Regions aria-live aria-atomic aria-relevant
- Testing with Screen Readers