I am trying to dynamically filter a list of members who have been 'tagged' with sectors using a menu and a data-attribute (membersectors) containing the tags.
http://jsfiddle.net/richardblyth/yp8q3ewh/
The problem I am having is with the actual jQuery itself - because the data-membersectors is a comma separated list it does not seem to be selecting.
$("#js-select-sector").bind("change", function() { console.log((this.value)); //Show divs with data-attr which contain the selected value $("div.member-small[data-membersectors*='(" + this.value + ")']").show(); //Hide those with data-attr which do not contain the selected value $("div.member-small:not([data-membersectors*='(" + this.value + ")'])").hide(); }); When the user selects a sector from the menu, it should hide all which do not contain that 'tag'/sector (inside their data-membersectors)
Any pointers in the right direction would be greatly appreciated, thank you.