1. jQuery.expr[':'].aFilter =
function(elem, index, match){
return true; // Return true/false as per need
};
$('div.red').filter(':aFilter').doSomething();
i want pass some custom arguments to “jQuery.expr[‘:’].aFilter” function, is it possible to do it
In your case if someone did
$('div.red').filter(':aFilter(textHere)')You would usematch[3]in your function to do what you wanted with thetextHerestring.Here’s an example I use for case-insentitive contains search:
The use is:
$(":Contains(Text To Match)");In this case
m[3](“Text To Match”) is the passed param I care about.You can find a full list of the parameters in this answer.