在jQuery中是否有内置的函数/选择器来按值过滤输入?
我可以创建一个自定义选择器:
$.extend($.expr[":"], {
val: function(elem, index, match) {
return $(elem).val() == match[3];
}
});
Run Code Online (Sandbox Code Playgroud)
并像这样使用它:$("input:val('Some text')").
我只是想知道这样的事情是否已经存在或者是否有更好的方法.
jquery ×1