And jQuery selector

Is it possible to use the AND selector in jQuery? I try to filter the results when I need multiple selectors to be true. This is what I use, but instead of "OR", so "," 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');
+3
source share
1 answer

Yes, you can do it, you are really looking combined attribute selector.

Give it a try

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

All Articles