-
Notifications
You must be signed in to change notification settings - Fork 0
/
Search.html
26 lines (26 loc) · 1.53 KB
/
Search.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
<section id="page_searchbox">
<input id="page-search" placeholder="Search" default="search_result" type="text"><button style="display: none;" id="find">Search</button>
<script>
setInterval(function() {
var search=document.getElementById("page-search");
var results=document.getElementsByClassName("search_result");
for(var a=0;a<results.length;a++) {
results[a].style.display="none";
}
var relevant=document.getElementsByClassName(search.value);
for(var a=0;a<relevant.length;a++) {
relevant[a].style.display="block";
}
if(search.value.length==0) {
for(var a=0;a<results.length;a++) {
results[a].style.display="block";
}
}
},1);
</script>
<section id="page_results>
<a href="/" class="search_result h ho hom home" style="display: block;">Home</a>
<a href="/page.html" class="search_result p pa pag page" style="display: block;">Search</a>
</section>
</section>
<!--This page must not have any elements that are supposed to be hidden. If an element that should be hidden has a class property applied, it could be accidentally revealed. A solution could be embedding the search field.