Commit 9b6df19c authored by John Resig's avatar John Resig

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.
parent 3811ac4b
...@@ -291,6 +291,14 @@ jQuery.fn = jQuery.prototype = { ...@@ -291,6 +291,14 @@ jQuery.fn = jQuery.prototype = {
}, },
filter: function(t) { 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 ); return this.pushStack( jQuery.filter(t,this.cur).r );
}, },
not: function(t) { not: function(t) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment