const searchTerm = "clientname";
document.querySelectorAll("tr").forEach(row => {
const cells = row.querySelectorAll("td");
const matches = [...cells].some(td =>
td.textContent.toLowerCase().includes(searchTerm.toLowerCase())
);
if (matches) {
const checkbox = row.querySelector("input[type='checkbox']");
if (checkbox) {
checkbox.checked = true;
console.log("Checked row:", row.textContent.trim().substring(0, 80));
}
}
});
Leave a Reply