<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
</head>
<body>
<div>
<label>
<input type="checkbox" value="1">
</label>
<label>
<input type="checkbox" value="2">
</label>
<label>
<input type="checkbox" value="3">
</label>
<label>
<input type="checkbox" value="4">
</label>
<label>
<input type="checkbox" value="5">
</label>
<label>
<input type="checkbox" value="6">
</label>
<label>
<input type="checkbox" value="7">
</label>
<label>
<input type="checkbox" value="8">
</label>
<label>
<input type="checkbox" value="9">
</label>
<label>
<input type="checkbox" value="10">
</label> </div>
<input class="ceshi" type="button" value="确定"> <script>
$(".ceshi").on("click", function(){
var num = $("div label").length;
var zhi = []
for(var i = 0; i < num; i++) {
if ($("div label").eq(i).find("input").is(":checked")) {
var chk = $("div label").eq(i).find("input").val();
zhi.push(chk);
};
}
alert(zhi);
})
</script>
</body>
</html>

作品第一课----获取批量checkbox选中的值的更多相关文章

  1. webform开发经验(一):Asp.Net获取Checkbox选中的值

    webform中获取repeat控件列表下的checkbox选中的值: 码农上代码: public static string getSelectedIDs(Repeater Rpt_) { stri ...

  2. jQuery实现的全选、反选和获取当前所有选中的值功能

    链接: jQuery实现的全选.反选和获取当前所有选中的值功能 <ul id="list"> <li><label><input type ...

  3. CheckBoxList 获取与设置选中的值

    /// <summary> ///CheckBoxListHelper 的摘要说明 ///CheckBoxList获取与设置选中的值 /// </summary> public ...

  4. jquery获取单选button选中的值

    在页面上单选button的代码: <s:iterator value="@com.hljw.cmeav.util.CmeavGlobal@isComMap"> < ...

  5. 获取select标签选中的值

    js获取select标签选中的值 var obj = document.getElementById(”testSelect”); var index = obj.selectedIndex; var ...

  6. js获取select标签选中的值[转]

    var obj = document.getElementByIdx_x(”testSelect”); //定位id var index = obj.selectedIndex; // 选中索引 va ...

  7. js获取select标签选中的值及文本

    原生js方式: var obj = document.getElementByIdx_x(”testSelect”); //定位id var index = obj.selectedIndex; // ...

  8. 使用jQuery获取radio/checkbox组的值的代码收集

    <!-- $("document").ready(function(){ $("#btn1").click(function(){ $("[na ...

  9. jquery 获取easyui combobox选中的值、赋值

    jquery easyui combobox 控件支持单选和多选 1.获取选中的值 $('#comboboxlist').combobox('getValue');  //单选时 $('#combob ...

随机推荐

  1. EOF是什么?

    转自http://www.ruanyifeng.com/blog/2011/11/eof.html 学习C语言的时候,遇到的一个问题就是EOF. 它是end of file的缩写,表示"文字 ...

  2. 线段树(单点更新)HDU1166、HDU1742

    在上一篇博文里面,我提到了我不会线段树,现在就努力地学习啊! 今天AC一题感觉都很累,可能是状态不佳,在做HDU1166这题目时候,RE了无数次. 原因是:我的宏定义写错了,我已经不是第一犯这种错误了 ...

  3. 如何在WCF中集成unity

    第一种是代码方式: 点击打开链接http://blogs.microsoft.co.il/gadib/2010/11/30/wcf-and-unity-20/ 还有一种方式可以扩展成配置文件,有时间再 ...

  4. Swift语言 1小时速学教程

    本文由 张渊杰 (网名寂静)编写 Swift语言 1小时速学教程 写在前面的话 有些人可能想, 呵呵, 1小时学一门语言, 你不是搞笑吧, 我想说, 是的, 完全可以, 就要看你怎么学了 要想在1小时 ...

  5. 基于ARM-LINUX的温度传感器驱动(DS18B20) .

    DS18B20数字温度传感器接线方便,封装成后可应用于多种场合,如管道式,螺纹式,磁铁吸附式,不锈钢封装式,型号多种多样,有LTM8877,LTM8874等等.主要根据应用场合的不同而改变其外观.封装 ...

  6. python 三分钟入门

    1.Python环境配置(2.7版本): Python官网:https://www.python.org/ Pycharm官网 http://www.jetbrains.com/pycharm/dow ...

  7. Dev表格导出工具类 z

    using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace xSof ...

  8. 每天学点管理学知识——情绪ABC理论

    什么是ABC理论 ABC理论(ABC Theory of Emotion)是由美国心理学家埃利斯创建的.就是认为激发事件A(activating event 的第一个英文字母)只是引发情绪和行为后果C ...

  9. chrome浏览器默认样式覆盖input背景

    问题描述:input表单添加了背景图片,结果自动填充是,编程了一个淡黄色矩形方框. 解决方案:网上查询了很多的解决方式,基本都不管用,这里我简单说两个. 1.去除黄色背景 input:-webkit- ...

  10. ArrayList与Vector、HashMap与HashTable

    摘自api: 1.ArrayList与Vector: 原文:This class(ArrayList) is roughly equivalent to Vector, except that it ...