我用的是ajax异步删除。
选中的项能被删除,但是选的两项被删除后下面的两项就被选中了。
我在页面上使用了:
$("input[@type='checkbox']").each(function(){$(this).attr("checked",false)});
没有起作用。

解决方案 »

  1.   


     //全选或全不选
            $(function() {
                    $('#CheckAll').click(function() {
                            // 全选或者取消全选
                            $('input[type=checkbox]').attr("checked", $(this).attr("checked"));
                    })
            });
            // 删除按钮
            $('#BtnDelete').click(function() {
                    var msg = confirm("确定删除吗?");
                    if (msg) {
                            var strids = "";
                            $("input[type=checkbox]:checked:not('#CheckAll')").each(function() {
                                    // 获得ID
                                    strids += $(this).parent().next("td").next("td").html() + "|";
                                    //$('#Hidden7').val(strids);
                            });
                            $.ajax({
                                    type: "get",
                                    //请求方式
                                    url: "../ajax/AjaxDeleteRes.ashx",
                                    //载入页面的URL地址
                                    data: {
                                            id: strids
                                    },
                                    success: function(data) { //返回成功的函数
                                            if (data.toString().substring(0) == "0") {
                                                    alert('删除成功!');
                                                    FN_SerchByDate();
                                            }
                                    }
                            });
                    }
            });
      

  2.   

    $('input:checkbox').each(function () {$(this).attr('checked',false);});
      

  3.   

    问题解决了。
    谢谢大家!!!!
     
     $('input[type=checkbox]').attr("checked", $(this).attr("checked",false));

    $('input:checkbox').each(function () {$(this).attr('checked',false);});这两种方法我都行我都试了