-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest.html
More file actions
52 lines (48 loc) · 1 KB
/
test.html
File metadata and controls
52 lines (48 loc) · 1 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
52
<html>
<head>
<meta charset="utf-8">
<title>Filter</title>
<style>
body {
padding: 50px;
font: 12px "Helvetica Neue", Arial, Helvetica, sans-serif;
}
input {
padding: 10px;
border: 1px solid #eee;
border-top-color: #ddd;
border-radius: 2px;
}
.hide {
opacity: .1;
}
</style>
</head>
<body>
<h1>Filter</h1>
<input type="text" placeholder="Search" />
<ul>
<li>Tobi Ferret</li>
<li>Loki Ferret</li>
<li>Jane Ferret</li>
<li>Manny Cat</li>
<li>Luna Cat</li>
<li>Abby Ferret</li>
<li>Ewald Ferret</li>
<li>Bandit Ferret</li>
<li>Simon Dog</li>
</ul>
<script src="build/build.js"></script>
<script>
var filter = require('filter');
var ul = document.querySelector('ul');
var input = document.querySelector('input');
input.onkeyup = function(e){
var str = input.value;
filter(ul, function(li){
return ~li.textContent.indexOf(str);
});
};
</script>
</body>
</html>