I have the script below to filter unordered list of links (ul, li, a) , the problem is the search is too slow on computer and freeze completlly on mobile, the list is about 19000 link, is it a problem inn the script or is it something else, any ideas?
function myFunction3() {
var input, filter, ul, li, a, i;
input = document.getElementById("myInput");
filter = input.value.toUpperCase();
ul = document.getElementById("myUL");
li = ul.getElementsByTagName("li");
for (i = 0; i < li.length; i++) {
a = li[i].getElementsByTagName("a")[0];
if (a.innerHTML.toUpperCase().indexOf(filter) > -1) {
li[i].style.display = "";
} else {
li[i].style.display = "none";
}
}
}
</script>