Select All Rows of Table

Select All Rows of Table

d4v1dv00d4v1dv00 Posts: 2Questions: 2Answers: 0

HI there, I tried many ways but all examples not working for me. Here are my row select code:

$('#table tbody').on('click', 'tr', function() {
     $(this).toggleClass('selected');
});

now i want to implement the select all and select none button:

select all code:

$('#table tr').addClass('row_selected');

select none code:

$('#table tr').removeClass('row_selected');

what am i missing?

thanks

This discussion has been closed.