手册目录
介绍
如有疑问欢迎到这些地方交流,欢迎加入JSLite.io组织团伙共同开发!
筛选出与指定表达式匹配的元素集合。
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"
})
科技资讯
24小时阅读榜
1
2
3
4
5
6
7
8
9
10
精品课程
共5课时 | 18.1万人学习
共49课时 | 82.7万人学习
共29课时 | 65.3万人学习
共25课时 | 41.5万人学习
共43课时 | 77.1万人学习