whisper.cat/weboasis/faq/oasis/search.min.js

1 line
603 B
JavaScript
Raw Normal View History

2023-10-05 23:28:32 +11:00
const input=document.getElementById("searchInput"),divsList=document.getElementsByClassName("panel");function searchFilter(){var a,b;a=input.value.toUpperCase();for(var c=0;c<divsList.length;c++)b=divsList[c].textContent,-1<b.toUpperCase().indexOf(a)&&!divsList[c].classList.contains("toggleAnswer")?divsList[c].style.display="block":-1<b.toUpperCase().indexOf(a)&&divsList[c].classList.contains("toggleAnswer")?divsList[c].previousElementSibling.style.display="block":divsList[c].style.display="none"}function clearSearch(){input.value="";for(var a=0;a<divsList.length;a++)divsList[a].style.display=""}