This works:
$('#ShowAll').click(function() {
if ($(this).prop('checked')) {
$('tr.hidden').show(); // todo: There's probably some clever toggle that could be used here.
} else {
$('tr.hidden').hide();
}
});
Is there a one-liner I can be doing instead?
When the user clicks on the ShowAll
checkbox
, then show all the rows that have a class of hidden
, else hide all the rows that have a class of hidden
.