Live Region
Announce dynamic changes to page without moving users location (Updated: March 23, 2022)
If an area of a page is dynamically updated without a full-page reload, we might (see FAQ: When Should A Live Region Be Used?) wish to inform the user that there was a change.
1
<div aria-live=”polite”>
2
<p>Newcastle United 0 - Barcelona 0</p>
3
</div>
Copied!
Whenever the inner text changes, or the CSS display of the content changes from none to block[1] , the screen reader will announce the contents.
1
<div aria-live=”polite”>
2
<p>Goal!</p>
3
</div>
Copied!
Screen reader announces “Goal!”
1
<div aria-live=”polite”>
2
<p>Newcastle United 1 - Barcelona 0</p>
3
</div>
Copied!
Screen reader announces “Newcastle United 1 - Barcelona 0".
Note, sometimes we may wish to announce the content that changed (as in this football score example), in other cases we may only wish to give an update as to the nature of the change (e.g. "Attention! Errors found"). A general rule of thumb is to keep the live-region short and free from structured data and interactive elements.
[1] It is very important to note that any CSS display operation must happen on a descendant node of the live region, and not on the live region node itself.
Copy link