Sergei Kriger
Sergei Kriger
@_sergeikriger
aria-live="polite | assertive | off"
<div></div>
<div aria-live="polite"></div>
<div aria-live="polite"></div>
const el = document.querySelector('div');
el.textContent = 'You liked it.'
polite
vs. assertive
vs. off
off
= nothing
"My mom always said life was like a box of chocolates – you never know what you're gonna get."
"My mom always said life was like a box of chocolates – you never know what you're gonna get."
aria-live="polite"
aria-live="assertive"
aria-live="off"
aria-controls="[ID] [ID]"
role="log"
role="status"
role="alert"
role="progressbar"
role="marquee"
role="timer"
<div></div>
const el = document.querySelector('div');
el.setAttribute('aria-live', 'polite');
el.textContent = 'You liked it.'
<div aria-live="polite"></div>
const el = document.querySelector('div');
el.textContent = 'You liked it.'
<div role="status" aria-live="polite"></div>
<div role="alert" aria-live="assertive"></div>
const liveRegion = new OnDemandLiveRegion({
level: 'polite'
});
liveRegion.say('You liked it.');
el.focus()
<button>
<a>
<input>
<textarea>
...
<div tabindex="0 | 1 | 2 | ...">
"My mom always said life was like a box of chocolates – you never know what you're gonna get."
aria-live="polite | assertive"
el.focus()
@_sergeikriger