i have problem with my live search the filtering is working but i want is only the <td>
tags can filter and the <th>
is not belong.
this is my html
<input />
<table class="AvailableGroupLab availGrpLabs avalLabs">
<tr>
<th>Name</th>
<th>Age</th>
</tr>
<tr>
<td><span>wewe</span>
</td>
<td>16</td>
</tr>
<tr>
<td><span>Melvin</span>
</td>
<td>18</td>
</tr>
<tr>
<td><span>Marvin</span>
</td>
<td>20</td>
</tr>
</table>
and the javascript
function filter(element) {
var $trs = $('.AvailableGroupLab tr').hide();
var regexp = new RegExp($(element).val(), 'i');
var $valid = $trs.filter(function () {
return regexp.test($(this).find('td:first-child').text())
}).show();
$trs.not($valid).hide()
}
$('input').on('keyup change', function () {
filter(this);
})