下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
第JQuery复选框全选效果如何实现第一种方法:选择器[属性名称=属性值]
$(input[type=checkbox]:gt(0)).prop(checked,this.checked);
第二种方法:使用层级选择器来实现tbodytrtdinput
$(tbodytrtdinput).prop(checked,this.checked);
第三种方法:
//#tabtbodytr:nth-child(4)td:nth-child(1)input[type=checkbox]
代码实现
!DOCTYPEhtml
html
head
metacharset=UTF-8
title/title
scripttype=text/JavaScriptsrc=../js/jquery-1.11.0.js/script
script
表格全选和全不选
进一步确定事件:点击事件
$(function(){
//绑定点击事件
//this代表的是当前函数的所有者
$(#checkAll).click(function(){
//获取当前选中状态
//alert(this.checked);
//获取所有分类项的checkbox
//选择器[属性名称=属性值]
//$(input[type=checkbox]:gt(0)).prop(checked,this.checked);
//使用层级选择器来实现tbodytrtdinput
//$(tbodytrtdinput).prop(checked,this.checked);//这个可行
//#tabtbodytr:nth-child(4)td:nth-child(1)input[type=checkbox]
$(input).prop(checked,this.checked);
/script
/head
body
tableborder=1pxwidth=600pxid=tab
thead
inputtype=checkboxid=checkAll/
/td
td分类ID/td
td分类名称/td
td分类商品/td
td分类描述/td
td操作/td
/tr
/thead
tbody
inputtype=checkbox/
/td
td1/td
td手机数码/td
td华为,小米,尼康/td
td黑马数码产品质量最好/td
ahref=#rel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollow修改/a|ahref=#rel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollow删除/a
/td
/tr
inputtype=checkbox/
/td
td2/td
td成人用品/td
td充气的/td
td这里面的充气电动硅胶的/td
tdahref=#rel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollow修改/a|ahref=#rel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollow删除/a/td
/tr
inputtype=checkbox/
/td
td3/td
td电脑办公/td
td联想,小米/td
td笔记本特卖/td
tdahref=#rel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollow修改/a|ahref=#rel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollow删除/a/td
/tr
inputtype=checkbox/
/td
td4/td
td馋嘴零食/td
td辣条,麻花,黄瓜/td
td年货/td
tdahref=#rel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollow修改/a|ahref=#rel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollow删除/a/td
/tr
inputtype=checkbox/
/td
td5/td
td床上用品/td
td床单,被套,四件套/td
td都是套子/td
tdahref=#rel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollowrel=externalnofollow修改/a|ahref=#rel=externalnofollowrel=externalnofollowrel=externalnofollowrel=exter
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026中南大学非事业编制工作人员招聘13人笔试模拟试题及答案解析
- 2026广西南宁市青秀区凤岭北路中学教师招聘笔试备考试题及答案解析
- 2026年四川省攀枝花市高职单招职业适应性测试考试题库有答案详细解析
- 2026重庆荣昌区招聘社区工作者后备人选454人笔试备考题库及答案解析
- 2026粤海控股集团所属粤西供水、科达水电公司招聘4人笔试模拟试题及答案解析
- 2026中兴通讯实习生招聘考试备考题库及答案解析
- 2025-2026学年西藏西藏达孜县达标名校初三下学期寒假验收考试英语试题含解析
- 2026届广东省番禺区六校教育教联合体初三下学期第三次质量考评英语试题含解析
- 安阳市安阳一中学2026年初三下学期第五次模拟语文试题含解析
- 河南省郑州一中市级名校2025-2026学年初三三模(最后一卷)英语试题试卷含解析
- 以我身份证在银行帮别人贷款协议书5篇
- 人行道铺设工程设计与施工方案
- 【10篇】三年级语文下册课外阅读专项练习题附参考答案
- 去极端化与民族团结课件
- 2025年大学试题(财经商贸)-商品学历年参考题库含答案解析(5套)
- 学堂在线 雨课堂 学堂云 遥测原理 章节测试答案
- 交通船管理办法
- 公益慈善活动创新创业项目商业计划书
- 学堂在线 雨课堂 学堂云 中国建筑史-史前至两宋辽金 章节测试答案
- 代理记账人员管理制度
- 公司管理层离职管理制度
评论
0/150
提交评论