jquery checkbox table列表,最多选中两个,最少选中一个

论坛 期权论坛 脚本     
匿名技术用户   2021-5-2 21:52   361   0
$('input[name=groupCheckBox]').click(function(){
  if($(this).parent().find("input[name='groupCheckBox']:checked").length >= 3)
  {
    $(this).removeAttr("checked");
    alert("图片雕刻行最多选择两个分组!")
  } else if($(this).parent().find("input[name='groupCheckBox']:checked").length < 1)
  {
    $(this).prop("checked",true);
    alert("图片雕刻行至少选择一个分组!")
  }
});
分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:7942463
帖子:1588486
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP