I have jQuery code which looks something like this
on Button1 Click
$('table.result_grid tbody tr')
.filter(function() {
var chkbox = $(this).find(':checkbox')[0];
return !chkbox.checked;
})
.show();
on Button2 Click
$('table.result_grid tbody tr')
.filter(function() {
var chkbox = $(this).find(':checkbox')[0];
return !chkbox.checked;
})
.hide();
on both the click it searches for the same tr.
Is there a way to optimize the above code?
Is there a way I can store the above tr in a variable blah and then say blah.hide()
or blah.show()
.