码迷,mamicode.com
首页 > 其他好文 > 详细

判断有几个checkbox被选中

时间:2017-05-25 14:38:21      阅读:150      评论:0      收藏:0      [点我收藏+]

标签:check   inpu   turn   box   number   div   return   type   选中   

//判断是否有选中的checkbox的值是否为空
var number = $("input[type=‘checkbox‘]:checked").length;
if(number == 0){
    alert(‘请选择要展示的图片!‘);
    return;
}

 

判断有几个checkbox被选中

标签:check   inpu   turn   box   number   div   return   type   选中   

原文地址:http://www.cnblogs.com/yangzailu/p/6903322.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!