-
Notifications
You must be signed in to change notification settings - Fork 1
/
wapa-demo.html
44 lines (35 loc) · 998 Bytes
/
wapa-demo.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<div id="listbox1" onariarequest="HandleRequest(event);">
<div>Item 1</div>
<div>Item 2</div>
<div>Item 3</div>
...
<div>Item 100</div>
</div>
<script>
var firsttime = true;
function HandleRequest(event) {
if (firsttime) {
firsttime = false;
initARIA();
}
}
function initARIA() {
var myList = document.getElementById("listbox1");
var myItems = myList.children;
myList.setAttribute("role", "listbox");
for (var i = 0; i < myItems.length; i++) {
myItems[i].setAttribute("role", "listitem");
myItems[i].setAttribute("aria-posinset", i+1)
myItems[i].setAttribute("aria-setsize", "100")
}
}
</script>
</body>
</html>