# input checkbox 多选 验证
```
<ul class="orderMsg_radio">
<!--单选--> <input value="1" type="checkbox" value=1 id="1" name="cart-pro" class="regular-radio">
<label for="1" class="sel-this"><em style="border-radius: 0"></em>电子手表</label> <input value="2" type="checkbox" value=2 id="2" name="cart-pro" class="regular-radio">
<label for="2" class="sel-this"><em style="border-radius: 0"></em>耳机</label> <input value="3" type="checkbox" value=3 id="3" name="cart-pro" class="regular-radio">
<label for="3" class="sel-this"><em style="border-radius: 0"></em>数据线</label> <input value="4" type="checkbox" value=4 id="4" name="cart-pro" class="regular-radio">
<label for="4" class="sel-this"><em style="border-radius: 0"></em>充电器</label> </ul>

var check_val ;
function fun(){
obj = document.getElementsByName("cart-pro");
  check_val=[]
for(k in obj){
if(obj[k].checked)
check_val.push(obj[k].value);
}
return check_val;
}
console.log(check_val); ```
输出你选中的 checkbox的值得数组

最新文章

  1. 2000条你应知的WPF小姿势 基础篇&lt;63-68 Triggers和WPF类逻辑结构&gt;
  2. Android 自定义View及其在布局文件中的使用示例
  3. ABAP游标的使用
  4. PHP simplexml_load_string 过滤&lt;![CDATA[XXXX]]&gt;
  5. lightning mdb 源代码分析(2)
  6. RMQ (Range Minimal Query) 问题 ,稀疏表 ST
  7. angularJs中的隐藏和显示
  8. 1128. Partition into Groups(图着色bfs)
  9. UIButton 按钮文字左对齐
  10. Asp.net实现在线人数统计功能代码实例
  11. (转)c#对象内存模型
  12. 移动开发中的Scheme跳转说明——Allowing OtherApps to Start Your Activity
  13. Linux中添加管理员权限问题:xxx is not in the sudoers file. This incident will be reported.
  14. vue过渡和animate.css结合使用
  15. 跨server传输数据注意事项
  16. 如何排查CPU飙升的Java问题
  17. 二、Redis安装
  18. .Net Core中的Api版本控制
  19. SQL server 2008(Linux安装)
  20. Redis和memcached缓存技术

热门文章

  1. html 弹框 优化 alert
  2. Python3乘法口诀表(由上至下+由下至上)
  3. R语言学习笔记(四):apply,sapply,lapply,tapply,vapply以及mapply的用法
  4. python2.7练习小例子(九)
  5. 浅析 Linux 初始化 init 系统,Systemd
  6. awk用法介绍
  7. 【数据结构】 List 简单实现
  8. 在Linux下通过rpm打包发布Java程序
  9. jmeter插件下载
  10. 第七篇数字&amp;字符串之练习题