Currently, I am in the process of developing a jQuery multiple filter module and have encountered a logic gap in my framework.
Within this module, there are numerous div elements each containing data-x and data-y attributes.
For instance:
<div class="divClass" data-x = "1" data-y="2">1</div>
<div class="divClass" data-x = "2" data-y="3">2</div>
<div class="divClass" data-x = "3" data-y="2">3</div>
<div class="divClass" data-x = "4" data-y="1">4</div>
This setup results in:
Upon selecting the values 2 and 3 for the y attribute along with 1 for the x attribute from the select boxes,
The desired query would be x = 1 and y = 2 or 3
Thus, it should display products
with data-y as 2 or 3 and data-x as 1
thus presenting products 1 and 2
$('[data-x="1"],[data-y="2"],[data-y="3"]').each(function(){
$("#result").append($(this).text() + ",");
});
The current implementation retrieves all products. My inquiry revolves around refining the query within the selector so I may effectively utilize the jQuery filter.