CheckBoxList 全选(jquery版本)

 function selectedAll(allselect, obj) {
            $("#"+obj.id+" input:checkbox").each(function () {
                if (allselect.checked)
                    $(this).attr("checked", true);
                else {
                    $(this).attr("checked", false);
                }
            });
        }

调用

<input id="allCheck" onclick="selectedAll(this, document.getElementById('cbl_cg'))" type="checkbox" name="allCheck" />全选/反选
原文地址:https://www.cnblogs.com/linyijia/p/3650080.html