不确定在 jQuery 文档中的何处可以找到它。我有一个在 DOM 上找到的 jQuery 元素。
在其中,我希望所有元素都具有 class == 'bar'
和 css 值 'display' == 'none'
。第一部分很简单:
$myElement.find(".bar");
如何获取此列表中 css 值为 'display' == 'none'
的所有元素?
如果可能,全部在一行中。谢谢!
最佳答案
你可以使用过滤器:
$myElement.find(".bar").filter(function(){
return $(this).css('display') == 'none';
}).Apply_your_jQuery_method_now();
关于javascript - jQuery 按类搜索且 css 值不等于 foo,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25771010/