JSFiddle - React, Tailwind, and code Playground

by Dave Mednick

HTML

<ul>
    <li class="single-line restore-manager">Here's an LI with some checkboxes
        <input type="checkbox" />
        <input type="checkbox" />
        <input type="checkbox" />
    </li>
</ul>

JavaScript

var allButChks = $(document).not("input:checkbox");
$(document).on("click", "li.single-line.restore-manager", function (e) {
    if (e.target.nodeName != "INPUT") {
        var myChks = $(this).children(":checkbox");
        $.each(myChks, function () {
            if ($(this).is(":checked") === true) {
                $(this).prop("checked", false);
            } else {
                $(this).prop("checked", true);
            }
        });
    };
});