W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
如有疑問歡迎到這些地方交流,歡迎加入JSLite.io組織團伙共同開發(fā)!
segmentfault社區(qū) | 官方網(wǎng)站 | 官方文檔-更詳細 | Issues
篩選出與指定表達式匹配的元素集合。
filter(selector)
filter(function(index){ ... })
篩選出與非
指定表達式匹配的元素集合。
$("div").filter("#box") //? self 在所有的div對象中選擇器為 #box 的過濾出來。
$("#select option").filter(function(idx){
console.log(this.selected)
return this.selected
})
//上面這種方法跟 not(function(index){ ... }) 是一樣的
not(selector) ? collection
not(collection) ? collection
not(function(index){ ... }) ? collection
篩選出與非
指定表達式匹配的元素集合。它的作用剛好與filter
相反,返回。
$("#select option").not(function(idx){
console.log(this.selected)
return this.selected
})
//? [哈哈3]
$("input").not("#input") //? 返回除去 匹配到的#input
$('input').not(function(){
console.log(this.type)
return this.type=="text"
})
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: