I would like jQuery to create a list of checkboxes based on the class / data present in the div. In essence, these flags will be filtered through products, so when you click on a flag, products containing this tag will be displayed in their div, avoiding any repeated flags.
Example:
<div class="Shoes" data-size="Small" data-color="Black"> <h3>Nike</h3> </div> <div class="Belts" data-size="Medium" data-color="Black"> <h3>Belt</h3> </div> <div class="Shirt" data-size="Large" data-color="Blue"> <h3>Polo</h3> </div> <div class="Socks" data-size="Small" data-color="White"> <h3>Generic Socks</h3> </div>
Expected Result Class Type
The size
Color
Each flag should be able to hide / show the element.
Jsfiddle
The code I have so far is a search for / previous answers, however it only creates 1 type of checkbox, which is for the "class", and not for creating a few.
source share