-
jquery 循环获取checkBox的值,以及对复选框选中,取消,操作按钮
- 法一:jquery 循环获取选中checkBox框的值
- function checkeds()
- {
- $("input:checkbox").each(function(index)
- {
- alert($("#checkid_"+index).val());
- });
-
- }
- 法二:jquery 循环获取选中checkBox框的值
- function checkeds(){
-
- $('input:checkbox[name="multiple"]:checked').each(function()
- {
- $(this).val();
- });
- }
-
- <input type="checkbox" id="checkid" name="multiple"class="input_w150" vili="true" onclick="checkeds()"/>
-
- <input type="checkbox" id="checkid" name="multiple"class="input_w150" vili="true" onclick="checkeds()"/>
-
-
-
- =====================第二部分=================================
-
- 1:进入页面时,按钮是置灰的,当选中复选框时将按钮设置成可以操作。
-
- <input type="checkbox" id="checkid" name="multiple"class="input_w150" vili="true" onclick="checkeds()"/>
-
- <input type="checkbox" id="checkid" name="multiple"class="input_w150" vili="true" onclick="checkeds()"/>
-
- <input type="button" value="ok" css="bc_submit" id="confirm_btn" disabled="true">
-
-
-
- jquery代码:
-
- function checks()
- {
- $("input:checkbox").each(function(index)
- {
-
- $("#checkid_"+index).click(function()
- {
-
-
- if($("input[name='multiple']:checked").length > 0) {
- $('#confirm_btn').removeAttr('disabled')
- return;
- }
- else
- {
- $('#confirm_btn').attr('disabled','disabled');
- }
- });
- });
- }
-
相关阅读:
samtools flags 分解
epollo
springaop 执行顺序问题
java解析String类型的xml
服务器调用服务器接口之间的抓包
windows下mysql忘了安装时的root密码
docker+jenkins+gitlab自动化构建
influxdb基本操作
记一次CPU过高排查过程
dockercompose部署一个可远程连接的容器
-
原文地址:https://www.cnblogs.com/ejllen/p/3622699.html
Copyright © 2020-2023
润新知