jQuery 判断多个 input checkbox 中至少有一个勾选

html ( 使用 TP 标签 ) :

<volist name="health_tag" id="htag">
     <input type="checkbox" class="helth_tag" name="health_tag[]" value="{$htag}"/>{$htag}
</volist>

 

js:

if($("input[class='helth_tag']:checked").length == 0){

     alert("至少勾选一个健康标签!");
     return false;
}   

 

posted @ 2014-12-15 20:27  nemo20  阅读(1165)  评论(0编辑  收藏  举报
访客数:AmazingCounters.com
2016/05/17 起统计