I have a set of divs eg:
<div class="wrapper">
<div class="uct_attr" data-tags="one two three four">stuff</div>
<div class="uct_attr" data-tags="three four">stuff</div>
<div class="uct_attr" data-tags="one three five">stuff</div>
<div class="uct_attr" data-tags="one two six">stuff</div>
<div class="uct_attr" data-tags="four five six">stuff</div>
</div?
How do I perform and action on the ones that match my query and another on the ones that dont? Keeping in mind I one wish to match one of the words in the attribute data-tags
eg:
// if match 'one'
$('.wrapper .uct_attr[data-tags="one"]').doMatch();
// the rest that didn't match 'one'
$('.wrapper .uct_attr[data-tags!="one"]').doNotMatch();
Issue I think is there are multipul tags in that attribute.
Any help on this would be great.
C
Simple enough: Use the member-of-a-whitespace-delimited-list selector.