web前端|js教程
jQuery,全选,反选
web前端-js教程
新电影网站源码,ubuntu桌面启动异常,通用爬虫的策略,php文件变成浏览器怎么办,帝国seo标题lzw
1.概述
前端商业全套源码,vscode如何改变语言,Ubuntu单面内存,jstl tomcat8,爬虫 作用,php免费企业模板,云南seo外包优化效果,彩票销售网站源码,旅游模板 源码lzw
在项目中经常遇到列表中对复选框进行勾选操作,全选。。。反选。。
评级鉴定网站源码,ubuntu软件中心修复,手机安装爬虫框架,php textcard,内乡seo优化lzw
2. example
$(function(){(function(){varform = $(#test-form),langs = form.find([name=lang]),selectAll = form.find(label.selectAll :checkbox),selectAllLabel = form.find(label.selectAll span.selectAll),deselectAllLabel = form.find(label.selectAll span.deselectAll),invertSelect = form.find(a.invertSelect);// 重置初始化状态:form.find(*).show().off();form.find(:checkbox).prop(checked, false).off();deselectAllLabel.hide();// 拦截form提交事件:form.off().submit(function (e) {e.preventDefault();alert(form.serialize());});var count = 1; //点击全选/全不选框次数selectAll.click(function(){if(count++ %2){selectAllLabel.hide();deselectAllLabel.show();$(this).prop("checked", false);langs.prop("checked", true);}else {selectAllLabel.show();deselectAllLabel.hide();$(this).prop("checked", false);langs.prop("checked", false);}});invertSelect.on(click, function(){langs.map(function(){$(this).prop(checked, !this.checked);});});})();});