Search inside a table
Shows only the rows where any cell contains the text.
jQuery · Search inside a tableIntermediate
$('#table-search').on('keyup input', function () {
const q = this.value.toLowerCase();
$('#data tbody tr').each(function () {
const match = $(this).text().toLowerCase().indexOf(q) > -1;
$(this).toggle(match);
});
$('#shown').text($('#data tbody tr').filter(function () { return this.style.display !== 'none'; }).length);
});tablefiltersearchrows