天天看點

點選表格某行選中行,選中或者取消選中複選框

$('body').on("click","tr",function(){
        if ($(this).find(":checkbox").prop("checked")) { 此處要用prop不能用attr,至于為什麼你測試一下就知道了
            $(this).find(":checkbox").removeAttr("checked"); 
        }else{
            $(this).find(":checkbox").prop("checked", true);
       }
    });