mirror of
https://github.com/jquery/jquery.git
synced 2025-01-10 18:24:24 +00:00
Multi-filtering is now in place, you can do:
$("div").filter(".this,.or,.that") and find all elements that match any of the three expressions.
This commit is contained in:
parent
3811ac4b5c
commit
9b6df19cc4
8
jquery/jquery.js
vendored
8
jquery/jquery.js
vendored
@ -291,6 +291,14 @@ jQuery.fn = jQuery.prototype = {
|
||||
},
|
||||
|
||||
filter: function(t) {
|
||||
if ( /,/.test(t) ) {
|
||||
var p = t.split(/\s*,\s*/);
|
||||
return this.pushStack( $.map(this.cur,function(a){
|
||||
for ( var i = 0; i < p.length; i++ )
|
||||
if ( jQuery.filter(p[i],[a]).r.length )
|
||||
return a;
|
||||
}) );
|
||||
} else
|
||||
return this.pushStack( jQuery.filter(t,this.cur).r );
|
||||
},
|
||||
not: function(t) {
|
||||
|
Loading…
Reference in New Issue
Block a user