MCPcopy Create free account
hub / github.com/Useful-Scripts-Extension/useful-script / search

Function search

scripts/fb_searchGroupForOther_main.js:66–80  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

64}
65
66function 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
82main();

Callers 1

mainFunction · 0.70

Calls 2

addMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected