How to add class all row : In given example, I can select/deselect each row on clicking on checkbox from td, but how to select/deselect all row on click  id="selectAll" from th

**JS :**

    $(document).ready(function () {
    
        $("input[type='checkbox']").change(function (e) {
            if ($(this).is(":checked")) {
                $(this).closest('tr').addClass("warning");
            } else {
                $(this).closest('tr').removeClass("warning");
            }
        });
    });

**Demo Here (Fiddle)**


  [1]: https://fiddle.jshell.net/w9zkwb1f/