I used w3School code for my page and it works fine but it only filters one column, don’t know how create loops but hopping there is easier solution.
td =
I uploaded the code here to search table data among two columns
function searching() {
var input, filter, table, tr, td1, td2, i, txtValue;
input = document.getElementById("search");
filter = input.value.toUpperCase();
table = document.getElementById("table");
tr = table.getElementsByTagName("tr");
for (i = 0; i < tr.length; i++) {
td1 = tr[i].getElementsByTagName("td")[0];
td2 = tr[i].getElementsByTagName("td")[1];
if (td1 || td2) {
txtValue1 = td1.textContent || td1.innerText;
txtValue2 = td2.textContent || td2.innerText;
if (txtValue1.toUpperCase().indexOf(filter) > -1 || (txtValue2.toUpperCase().indexOf(filter) > -1)) {
tr[i].style.display = "";
} else {
tr[i].style.display = "none";
}
}
}
}
Sr No.
Item
Description
Manage