-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
74 lines (69 loc) · 2.03 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
<html><body onload="document.getElementById('search').focus()">
<script src="./instafilter.js"></script>
<script type="text/javascript">
let options = {
listSelector: '#items',
itemSelector: 'li',
contentSelector: '.text'
};
window.onload = function() {
let searchInput = document.getElementById('search');
Instafilter.activate(searchInput, options);
document.getElementById('search').focus();
};
</script>
<h1>Search the Garden</h1>
<div>
<label for="garden-search">Begin typing to filter the list:</label>
<input type="text" value="" name="garden-search" id="search" />
</div>
<ul id="items">
<li>
<a href="http://example.com/this/url/is/not/searched" class="text">
Cauliflower
</a> | <a>(This text is not searched)</a>
</li>
<li>
<a href="http://example.com/this/url/is/not/searched" class="text">
Broccoli
</a> | <a>(This text is not searched)</a>
</li>
<li>
<a href="http://example.com/this/url/is/not/searched" class="text">
Carrot
</a> | <a>(This text is not searched)</a>
</li>
<li>
<a class="text">Cucumber</a>
</li>
<li>
<a class="text">Potato</a>
</li>
<li>
<a class="text">Pepper</a>
</li>
<li>
<a class="text">Tomato</a>
</li>
<li>
<a class="text">Onion</a>
</li>
<li>
<a class="text">Squash</a>
</li>
</ul>
<p style="width: 50%">
This is a "fuzzy search" -- you can type nonconsecutive
characters, and as long as those letters appear in the result
from left to right, it will match.
</p>
<p>
Try these: co, oo, clf, cc
</p>
<p style="width: 50%">
Note that you specify a selector indicating which element
should be examined during the search. All other content in the
matching item is ignored. So, a search for 'text'
or 'href' or 'example.com' finds nothing.
</p>
</body></html>