1

    <script>
        $(function () {
            //全选
            $("#chkAll").click(function () {
                $("[name='chkItem']").prop("checked", $("#chkAll").prop("checked"));
            })
        })

        function Dels() {

            var arr = [];
            if (confirm("确认删除吗?")) {
                $("[name='chkItem']:checked").each(function () {
                    arr.push($(this).val());
                })

                $.ajax({
                    url: "/Students/DeleteInfo",
                    type: "get",
                    data: { id: arr.toString() },
                    success: function (data) {
                        if (data > 0) {
                            alert("删除成功!");
                            location.href = "/Students/Index";
                        }
                    }
                })
            }
        }
    </script>

原文地址:https://www.cnblogs.com/jcy1/p/9530937.html