下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
第JQuery復選框全選效果如何實現(xiàn)第一種方法:選擇器[屬性名稱=屬性值]
$(input[type=checkbox]:gt(0)).prop(checked,this.checked);
第二種方法:使用層級選擇器來實現(xiàn)tbodytrtdinput
$(tbodytrtdinput).prop(checked,this.checked);
第三種方法:
//#tabtbodytr:nth-child(4)td:nth-child(1)input[type=checkbox]
代碼實現(xiàn)
!DOCTYPEhtml
html
head
metacharset=UTF-8
title/title
scripttype=text/JavaScriptsrc=../js/jquery-1.11.0.js/script
script
表格全選和全不選
進一步確定事件:點擊事件
$(function(){
//綁定點擊事件
//this代表的是當前函數(shù)的所有者
$(#checkAll).click(function(){
//獲取當前選中狀態(tài)
//alert(this.checked);
//獲取所有分類項的checkbox
//選擇器[屬性名稱=屬性值]
//$(input[type=checkbox]:gt(0)).prop(checked,this.checked);
//使用層級選擇器來實現(xiàn)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手機數(shù)碼/td
td華為,小米,尼康/td
td黑馬數(shù)碼產(chǎn)品質(zhì)量最好/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聯(lián)想,小米/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. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 陜西省西安建筑科技大學附屬中學2025-2026學年七年級上學期期末語文試題(含答案)(解析版)
- 2026貴州黔東南州鎮(zhèn)遠縣第一批城鎮(zhèn)公益性崗位人員招聘50人備考題庫及完整答案詳解一套
- 2026年社交媒體廣告精準投放指南
- 非金屬廢料處理質(zhì)量檢驗與管控手冊
- 2026重慶奉節(jié)縣青蓮鎮(zhèn)招聘公益性崗位6人備考題庫及答案詳解(新)
- 2026年碳交易市場操作實務(wù)培訓
- 計算機行業(yè)“一周解碼”:網(wǎng)絡(luò)安全政策再加碼
- 職業(yè)噪聲與心血管疾病政策干預的效果評估
- 職業(yè)共病管理中的人才培養(yǎng)模式
- 職業(yè)健康監(jiān)護中的個性化干預方案制定
- 交通事故培訓
- 金融投資分析與決策指導手冊(標準版)
- 【初中 地理】2025-2026學年人教版八年級地理下冊知識點匯Z
- 2025年版廉政知識測試題庫(含答案)
- 機械制圖教案
- 新疆干旱的原因
- 九年級 22天1600個中考詞匯背默專項訓練(英語)
- 老年心血管疾病預防與治療
- PICC導管標準維護流程教案(2025-2026學年)
- 護士長采血防淤青課件
- 糖尿病合并心臟病護理查房
評論
0/150
提交評論