2012-10-12 66 views

回答

0

:checkbox选择已被弃用,请尝试使用$('[type=checkbox]')方法

+0

我认为你的意思是:checkbox选择器已被弃用,请使用$('[type = checkbox]')。 – Aktee

+0

@Aktee oops在这里输入错误,谢谢 –

0

试试这个

$(function() { 
    $(":checkbox").click(function() { 
     $(this).parent().find(":checkbox").attr("checked", this.checked); 
    }); 
});​ 

// OR

$(function() { 
    $("input[type=checkbox]").click(function() { 
     $(this).parent().find("input[type=checkbox]").attr("checked", this.checked); 
    }); 
});​ 

CHECK FIDDLE