-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharia-live-search.html
More file actions
51 lines (40 loc) · 1.26 KB
/
Copy patharia-live-search.html
File metadata and controls
51 lines (40 loc) · 1.26 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ARIA live: AccessU Accessible JavaScript</title>
<style>
body { font-family: Arial, sans-serif; margin: 0; padding: 20px; font-size:1.2em;}
</style>
</head>
<body>
<h1>ARIA live search result test</h1>
<!-- Create a form for search field -->
<!-- Create an aria-live region that will be filled with the number of search results -->
<!-- Create a section that will get filled with the full results -->
<script>
// Add an event listener to the form submit
// Get searchResults (let's pretend it was an API call)
// Insert the search results to the search results
// Update the aria-live region with a summary of the results
const searchResults = [
{
title: "Title number 1",
author: "Super-cool author",
summary: "Summary of really super-cool things."
},
{
title: "Title number 2",
author: "Extra author",
summary: "Summary of really extra things."
},
{
title: "Title number 3",
author: "Unknown author",
summary: "Summary of really unknown things."
},
]
</script>
</body>
</html>