Js-Html 前端系列--全选,反选
来源:互联网 发布:灵魂摆渡风华绝代知乎 编辑:程序博客网 时间:2024/05/22 11:14
/* 全选 */ $("#selectedAll").click(function(){ var boxcList = $(".boxc");var boxcList1 = $(".boxcp"); var c = $(this).attr("checked"); if(c == "undefined"||c == undefined||c == false){ boxcList.prop("checked",true); boxcList.attr("checked",true); boxcList1.prop("checked",true); boxcList1.attr("checked",true); $(this).prop("checked",true); $(this).attr("checked",true); }else{ boxcList.removeAttr("checked"); boxcList1.removeAttr("checked"); $(this).removeAttr("checked"); } }); /* 反选 */ $("#backselectedAll").click(function(){ var boxcList = $(".boxc");var boxcList1 = $(".boxcp"); for(var i=0;i<boxcList.length;i++){ var c = boxcList.eq(i).attr("checked"); if(c == "undefined"||c == undefined||c == false){ boxcList.eq(i).prop("checked",true); boxcList.eq(i).attr("checked",true); }else{ boxcList.eq(i).removeAttr("checked"); } } for(var i=0;i<boxcList1.length;i++){ var c = boxcList1.eq(i).attr("checked"); if(c == "undefined"||c == undefined||c == false){ boxcList1.eq(i).prop("checked",true); boxcList1.eq(i).attr("checked",true); }else{ boxcList1.eq(i).removeAttr("checked"); } } });
Js产生两个首尾相连的记时器
<script>var time=0; setTimeout(a(), 1000); alert("开始") function b(){ alert("么么哒 "+time++) setTimeout(a(), 5000); } function a(){ alert("萌萌哒 "+time++) setTimeout(b(), 5000); }</script>
1 0
- Js-Html 前端系列--全选,反选
- JS控制HTML全选和反选
- js全选反选+HTML加载
- JS全选,反选
- js 全选 ,反选
- js 全选反选
- JS全选反选
- js全选反选
- js 全选,反选
- html全选反选功能
- 全选---反选---删除---HTML
- js全选,不全选,反选
- js 全选,取消全选,反选
- 全选反选代码JS
- js全选与反选
- js全选,反选,取消
- JS全选,反选,取消
- js checkout 全选 反选
- 查看android源码的版本号
- Centos 7 防火墙firewall配置
- C++虚函数与虚函数表
- jedis
- oracle 的那些事儿
- Js-Html 前端系列--全选,反选
- Android开始写笔记
- Windows列表框类
- Halcons模板匹配-读取数字
- 从学校第一次踏出
- 编译Android系统源码和内核源码
- iOS_SpriteKit_01_初识SpriteKit
- Java ArrayList学习
- unity 2D 透明遮罩 简单实现物体一半透明