(text)
| 64 | } |
| 65 | |
| 66 | function search(text) { |
| 67 | let count = 0; |
| 68 | [...tableDiv.querySelectorAll("tr")].forEach((tr, index) => { |
| 69 | if (index == 0) return; // ignore table header |
| 70 | |
| 71 | let html = tr.innerHTML; |
| 72 | if (!html.toLowerCase().includes(text.toLowerCase())) { |
| 73 | tr.classList.add("hidden"); |
| 74 | } else { |
| 75 | tr.classList.remove("hidden"); |
| 76 | count++; |
| 77 | } |
| 78 | }); |
| 79 | searchCount.innerHTML = count; |
| 80 | } |
| 81 | |
| 82 | main(); |