php - jquery CONTAINS:text -
as seen in code below: in header part called
<input type="text" size="30" onkeyup="filter(this.value)" />
--
function filter(a){ if (a.length > 0) {$("tr").hide(); $("tr:contains('"+a+"')").show();} else {$("tr").show(); } }
i have list of items in table format wherein there 3 td, item code, item desc, item type
i have input box filter out table matching text inputted in textboxt match in item code only, not in whole tr.
how search in hide whole if doesnt match search? filter table 1 being typed.
html table generated sql select
try following:
$("td:contains("+ +")").parent('tr').show();
or
$('td').filter(function() { return $.trim( $(this).text() ) == a; }).parent('tr').show();
Comments
Post a Comment