简体   繁体   English

AND选择器jQuery

[英]AND selector jQuery

Is it possible to use an AND selector in jQuery? 是否可以在jQuery中使用AND选择器? I am trying to filter through results where I need multiple selectors to be true. 我试图过滤结果,我需要多个选择器为真。 This is what I use but instead of "OR" so the "," I use I want to use "AND". 这是我使用的,而不是“或”所以“,”我使用我想使用“和”。

$('div.job:not([data-province="'+province+'"])', 'div.job:not([data-employment="'+employment+'"])', 'div.job:not([data-education="'+education+'"])', 'div.job:not([data-branch="'+branch+'"])').fadeOut('slow');

Yes you can do that, you are actually looking for combined attribute selector . 是的,你可以这样做,你实际上正在寻找combined attribute selector

Try, 尝试,

$('div.job[data-province!="'+province+'"][data-employment!="'+employment+'"][data-education!="'+education+'"][data-branch!="'+branch+'"]').fadeOut('slow');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM