Initial commit
This commit is contained in:
commit
84cf241ce7
27 changed files with 484 additions and 0 deletions
18
js/script.js
Normal file
18
js/script.js
Normal file
|
@ -0,0 +1,18 @@
|
|||
function prsearch() {
|
||||
// Declare variables
|
||||
var input, filter, ul, li, a, i;
|
||||
input = document.getElementById("prsearch");
|
||||
filter = input.value.toUpperCase();
|
||||
ul = document.getElementById("products");
|
||||
li = ul.getElementsByTagName("li");
|
||||
|
||||
// Loop through all list items, and hide those who don't match the search query
|
||||
for (i = 0; i < li.length; i++) {
|
||||
a = li[i].getElementsByTagName("h4")[0];
|
||||
if (a.innerHTML.toUpperCase().indexOf(filter) > -1) {
|
||||
li[i].style.display = "";
|
||||
} else {
|
||||
li[i].style.display = "none";
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue