I have some function declared like this that check element for something(true, false):
(function($) {
$.myfunc = function(element, settings) {
// skiped return comparison
};
})(jQuery);
Then I want to use this function as an additional selector. I am trying sometime like this(of course its wrong code):
var lastprl = $("a[prl]").filter(function() { $.myfunc($(this), {param : 0}) }).last();
Seems the main idea is right to filter elements with my function, then select .last() from array. Please, help fix this code. Maybe I incorrectly use $.myfunc call? or something else?
.filter()requires a return value from the function you give it. Yourreturnis missing.Also make sure
$.myfuncis returning a boolean result.