Live Region
Announce dynamic changes to page without moving users location
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.
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.
Screen reader announces “Goal!”
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.
Last updated