<div aria-live="polite"><p id="demo" ></p></div>
<button onclick="myfun()">click me</button>
<div aria-live="polite" style="display:none" id="demo2"><p >Hello world</p>
</div>
<button onclick="myfun2()">click me</button>
<script>
function myfun() {
document.getElementById("demo").innerHTML = "Hello World!";
}
function myfun2() {
document.getElementById('demo2').style.display = 'block';
}
</script>
IE 11 | FireFox 47 | Chrome 51 | Safari 9.1.2 | |
---|---|---|---|---|
NVDA 2016.2 | Both examples work | Only example 1 works | Only example 1 works | N/A |
JAWS 17 | Both examples work | Both examples work | Both examples work | N/A |
VoiceOver for E capitaine | N/A | Neither example works | Only First example works | Only First example works |
NOTE: Changing the aria-live value to "assertive" did not change results
Don't depend on aria-live to announce content that has been turned on with display:none.