I am attempting to implement a small script within my table under the following conditions: The table contains a checkbox within each tr td, and I want my jQuery script to be applied only if the selector identifies a tr where all td checkboxes are unchecked. If only one checkbox is checked within a tr row, then I do not want to add a class to the parent tr.
Essentially, I need to add a class to the parent tr only when none of the td checkboxes within the entire tr row are selected.
Below is my script:
$(function () {
$('#callScr').on('click', function (e) {
$(".table tr input:not(:checked)").each(function (i, obj) {
$(this).parent().parent().addClass("yourClass");
});
})
});
Currently, the script is adding the class to all parent tr elements, even if one checkbox is selected...