input之checkbox用法
2015-06-10 11:52
411 查看
function getFids(){ fids=""; $('input[name="chBox"]:checked').each(function(){ fids+=$(this).val()+","; }); fids=fids.substring(0,fids.length-1); alert(fids); } function getAllFids(){ fids=""; if($('input[name="allBox"]').attr("checked")){//全选判定全选菜单是否选中 $('input[name="chBox"]').each(function(){ $(this).attr("checked",true); //alert($(this).attr("checked")); fids+=$(this).val()+","; fids=fids.substring(0,fids.length-1); }); } else{ $('input[name="chBox"]').each(function(){//遍历所有name位chBox的复选框 $(this).attr("checked",false); //alert($(this).attr("checked")); fids=""; }); } //fids=fids.substring(0,fids.length-1); //alert(fids); }
相关文章推荐
- HLS系统快速部署指南
- 实现页面切换(动画效果实现,不用ViewPager)
- IE6、IE7、IE8中overflow:hidden无效问题
- react的学习总结
- VS2012调试运行,网页打不开
- Android中获取apk基本信息
- CodeForces 515C. Drazil and Fa
- hihoCoder#1038 : 01背包
- 微信公众平台开发最佳实践(第2版)
- HTTP协议详解
- 修改Android启动画面
- 找回误删除的文件
- Java的内存机制
- 【HTML+CSS】(1)基础语法
- 事件绑定
- 在imp数据库时报错1045
- .net接口作用
- PMC云计算大会再出击 携众厂商高歌猛进
- android Dialog给Activity 传参
- UI控件问题和XCode编译警告和错误解决方法集锦 (持续更新ing)