Sources:
1 |
<input type="checkbox" id="" class"js-selectRow" name="" value="" /> |
1 2 3 4 5 6 7 8 9 10 |
$(document).on('change', '.js-selectRow', function() { const $_THIS = $(this); if ( $_THIS.prop('checked') === true ) { // if is checked do sth... $_THIS.closest('tr').addClass('row-isSelected'); } else if ( $_THIS.prop('checked') === false ) { // if is not checked do sth else... $_THIS.closest('tr').removeClass('row-isSelected'); } }); |