You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
627 B
25 lines
627 B
4 years ago
|
---
|
||
|
title: "Test ARIA-live region with label"
|
||
|
layout: default
|
||
|
---
|
||
|
|
||
|
<div id="test-aria" aria-live="polite" aria-label="Test label">
|
||
|
I am some text.
|
||
|
</div>
|
||
|
<button id="btn">Update labled ARIA region.</button>
|
||
|
<button id="btn2">Delete text</button>
|
||
|
<p>Test</p>
|
||
|
<script>
|
||
|
ALDIV = document.getElementById("test-aria");
|
||
|
NEW_TEXT = "new text;";
|
||
|
UPDATE_BTN = document.getElementById("btn");
|
||
|
DELETE_BTN = document.getElementById("btn2");
|
||
|
|
||
|
UPDATE_BTN.addEventListener('click', function(e) {
|
||
|
ALDIV.innerText = 'Updating... Hello world!';
|
||
|
});
|
||
|
DELETE_BTN.addEventListener('click', function(e) {
|
||
|
ALDIV.innerText = '';
|
||
|
});
|
||
|
</script>
|