如何实时的把checkbox设成false 本帖最后由 molaifeng 于 2012-07-25 20:18:01 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 $(document).ready( function() { $("input[name='ck[]']").click( function() { var o = $("input[name='ck[]']"); if (o.filter(":checked").length == 3) o.not(":checked").attr("disabled", "disabled"); else o.not(":enabled").removeAttr("disabled"); });});复选框name属性值改为ck[] $(function () { $('input[name="ck"]').click(function() { if($('input[name="ck"]:checked').size()==3)$('input[name="ck"]').not(':checked').attr('disabled',true); else $('input[name="ck"]:disabled').attr('disabled',false); })}) $(function () { $('input[name="ck"]').change(function() { var count = 0; $('input[name="ck"]').each(function () { if($(this).attr('checked') == true){ count++; } if(count == 3){ $('input[name="ck"]').each(function () { if($(this).attr('checked') == false){ $(this).attr('disabled',true); } }) } else if(count <= 2) { $('input[name="ck"]').each(function () { if($(this).attr('disabled') == true){ $(this).attr('disabled',false); } }) } }) })})刚刚自己又写了下,可以完成,不过方法太笨,有简化的么 浮动层+lightbox而已,参考lightbox实现的checkbox联动 extjs4的问题 关于treestore的 一个jQuery入门级问题 mp3搜索接口的问题 获取页面全文高度 谁有好点的javascript Menu类,我这知道一个但不支持中文,有愿意接受挑战的试试改成支持中文的。 网站上的视频如何限制只让免费看几分钟,其他的需要支付费用 求指导一个关于闭包的问题 新手疑问 怎样在客户端用Javascript 实现检测用户输入是否为数字或日期!!!! 高分请大虾帮我写一小段代码! 【紧急求助】JS如何取两个数组 不相同的值 关于easy-ui 中的treeGrid的数据显示问题
$("input[name='ck[]']").click( function() {
var o = $("input[name='ck[]']");
if (o.filter(":checked").length == 3) o.not(":checked").attr("disabled", "disabled");
else o.not(":enabled").removeAttr("disabled");
});
});复选框name属性值改为ck[]
$('input[name="ck"]').click(function() {
if($('input[name="ck"]:checked').size()==3)$('input[name="ck"]').not(':checked').attr('disabled',true);
else $('input[name="ck"]:disabled').attr('disabled',false);
})
})
$(function () {
$('input[name="ck"]').change(function() {
var count = 0;
$('input[name="ck"]').each(function () {
if($(this).attr('checked') == true){
count++;
}
if(count == 3){
$('input[name="ck"]').each(function () {
if($(this).attr('checked') == false){
$(this).attr('disabled',true);
}
})
}
else if(count <= 2) {
$('input[name="ck"]').each(function () {
if($(this).attr('disabled') == true){
$(this).attr('disabled',false);
}
})
}
})
})
})刚刚自己又写了下,可以完成,不过方法太笨,有简化的么