Sha256: f9056fdeba64b1cf57c087812a7be729105d9ca61cc78360522555f7bd8ae58c
Contents?: true
Size: 623 Bytes
Versions: 2
Compression:
Stored size: 623 Bytes
Contents
// function myFunction() { // Declare variables var input, filter, ul, li, a, i, txtValue; input = document.getElementById('myInput'); filter = input.value.toUpperCase(); ul = document.getElementById("searchableList"); 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("a")[0]; txtValue = a.textContent || a.innerText; if (txtValue.toUpperCase().indexOf(filter) > -1) { li[i].style.display = ""; } else { li[i].style.display = "none"; } } }
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
jekyll-notes-0.1.1 | assets/js/SearchBar.js |
jekyll-notes-0.1.0 | assets/js/SearchBar.js |