jquery1.6下attr()不能使用

今天无意之举,使用jquery1.6做个checkbox的全选效果。按照往常的写法:
//全选
$("#ckball").bind("click", function () {
if ($(this).attr("checked")) {
$(
".lb_two input[type=checkbox]").each(function () {
$(
this).attr("checked", true);
});
}
else {
$(
".lb_two input[type=checkbox]").each(function () {
$(
this).attr("checked", false);
});
}
})

 可悲的是,浏览器提示报错。经过google查阅,发现了jquery1.6下不支持attr的使用。最后只能用低版本或者1.6.1版本。
http://stackoverflow.com/questions/5969598/possible-bug-in-jquery-1-6-attrchecked-is-not-working

http://blog.darkthread.net/post-2011-05-13-jquery-1-6-1.aspx 

原文地址:https://www.cnblogs.com/zhxhdean/p/2083753.html