Is there a built-in function / selector in jQuery to filter inputs by value?
I can create a custom selector:
$.extend($.expr[":"], {
val: function(elem, index, match) {
return $(elem).val() == match[3];
}
});
and use it as follows: $("input:val('Some text')").
I'm just wondering if something like that exists, or maybe there is a better way.
source
share