-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
76 lines (73 loc) · 2.95 KB
/
index.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Combobox</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
font-family: sans-serif;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
[role="listbox"] {
list-style: none;
position: absolute;
margin: 0;
padding: 0;
}
[role="listbox"] [role="option"]:hover,
[role="listbox"] [role="option"][aria-selected="true"] {
background-color: lightgrey;
}
</style>
</head>
<body>
<form action="">
<label for="film">Animated Movie</label>
<input id="film" list="films" type="text"/>
<datalist id="films">
<option value="Superman: Doomsday">Superman: Doomsday</option>
<option value="Justice League: The New Frontier" />
<option value="Batman: Gotham Knight" />
<option value="Wonder Woman" />
<option value="Green Lantern: First Flight" />
<option value="Superman/Batman: Public Enemies" />
<option value="Justice League: Crisis on Two Earths" />
<option value="Batman: Under the Red Hood" />
<option value="Superman/Batman: Apocalypse" />
<option value="All-Star Superman" />
<option value="Green Lantern: Emerald Knights" />
<option value="Batman: Year One" />
<option value="Justice League: Doom" />
<option value="Superman vs. The Elite" />
<option value="Batman: The Dark Knight Returns" />
<option value="Superman: Unbound" />
<option value="Justice League: The Flashpoint Paradox" />
<option value="Justice League: War" />
<option value="Son of Batman" />
<option value="Batman: Assault on Arkham" />
<option value="Justice League: Throne of Atlantis" />
<option value="Batman vs. Robin" />
<option value="Justice League: Gods and Monsters" />
<option value="Batman: Bad Blood" />
<option value="Justice League vs. Teen Titans" />
<option value="Batman: The Killing Joke" />
<option value="Justice League Dark" />
<option value="Teen Titans: The Judas Contract" />
<option value="Batman and Harley Quinn" />
<option value="Batman: Gotham by Gaslight" />
<option value="Suicide Squad: Hell to Pay" />
<option value="The Death of Superman" />
</datalist>
</form>
<script src="listbox.js"></script>
<script src="combobox.js"></script>
<script>
document.querySelectorAll('input[list]').forEach(combobox.init);
</script>
</body>
</html>