Open jonverrier opened 2 months ago
function searchTable(){ var term, table; // get term to search term = document.getElementById("myInput").value.toLowerCase();
// get table rows, handle as array.
table = Array.from(document.getElementById("myTable").rows);
// filter non-matching rows; these are set to display='none'
table.filter(function(el){return el.textContent.toLowerCase().indexOf(term) ==
-1}).map(x=> x.style.display = "none");
// filter matching rows; these are set to display =''
table.filter(function(el){return el.textContent.toLowerCase().indexOf(term) > -1}).map(x=> x.style.display = "");
}
Likely a panel at the top - do some research on UI patterns.