-
Notifications
You must be signed in to change notification settings - Fork 1
/
live-region-test.html
55 lines (45 loc) · 1.69 KB
/
live-region-test.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Identifying errors</title>
<script>
window.onload = ready;
function ready() {
document.getElementById("article1").addEventListener("click", function() {
var x = document.getElementById("article1").getAttribute("id");
var y = document.getElementById("article1").style.display = "none";
status(x);
});
document.getElementById("article2").addEventListener("click", function() {
var x = document.getElementById("article2").getAttribute("id");
var y = document.getElementById("article2").style.display = "none";
status(x);
});
document.getElementById("article3").addEventListener("click", function() {
var x = document.getElementById("article3").getAttribute("id");
var y = document.getElementById("article3").style.display = "none";
status(x);
});
document.getElementById("article4").addEventListener("click", function() {
var x = document.getElementById("article4").getAttribute("id");
var y = document.getElementById("article4").style.display = "none";
status(x);
});
}
function status(a) {
var str = a;
var msg = str.slice(7);
document.getElementById("update").innerHTML = "Article" + msg + "removed";
}
</script>
</head>
<body>
<h1>Notification of button removal</h1>
<p id="update" style="width:0; height:0; overflow:hidden;" aria-atomic="true" role="alert" aria-live="assertive"></p>
<button id="article1" aria-label="Exclude article 1">Exclude</button>
<button id="article2" aria-label="Exclude article 2">Exclude</button>
<button id="article3" aria-label="Exclude article 3">Exclude</button>
<button id="article4" aria-label="Exclude article 4">Exclude</button>
</body>
</html>