mardi 21 juin 2016

i want to ask about checkbox/uncheckbox all

i want to uncheck checkbox "all" when i uncheck checkbok

 $('#All').click(function () {
        var status = $(this).is(":checked");
        if (status) {
            $.each($('input[name="checkbox"]'), function () {
                this.checked = true;
            })
            $('input[name="checkbox"]').attr("checked", "checked");

        } else {
            $('input[name="checkbox"]').removeAttr("checked");
            $.each($('input[name="checkbox"]:checked'), function () {
                this.checked = false;
            })
        }

    })

checkbox




Aucun commentaire:

Enregistrer un commentaire