Update html.js
This commit is contained in:
parent
23912e2169
commit
e2bb340448
|
|
@ -1,17 +1,17 @@
|
||||||
function search() {
|
function search() {
|
||||||
var input, filter, ul, li, a, i, txtValue;
|
var input, filter, list, listElement, details, i, txtValue;
|
||||||
input = document.getElementById('searchInput');
|
input = document.getElementById('searchInput');
|
||||||
filter = input.value.toUpperCase();
|
filter = input.value.toUpperCase();
|
||||||
ul = document.getElementById("referenceList");
|
list = document.getElementById("referenceList");
|
||||||
li = ul.getElementsByTagName('li');
|
listElement = list.getElementsByTagName('li');
|
||||||
|
|
||||||
for (i = 0; i < li.length; i++) {
|
for (i = 0; i < listElement.length; i++) {
|
||||||
a = li[i].getElementsByTagName("details")[0];
|
details = listElement[i].getElementsByTagName("details")[0];
|
||||||
txtValue = a.textContent || a.innerText;
|
txtValue = details.textContent || details.innerText;
|
||||||
if (txtValue.toUpperCase().indexOf(filter) > -1) {
|
if (txtValue.toUpperCase().indexOf(filter) > -1) {
|
||||||
li[i].style.display = "";
|
listElement[i].style.display = "";
|
||||||
} else {
|
} else {
|
||||||
li[i].style.display = "none";
|
listElement[i].style.display = "none";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue