I have the following html:
<li>
<select class="variation">
<option value="1">1</option>
<option value="2">2</option>
</select>
<p class="price"></p>
</li>
This is duplicated multiple times (list of products).
By default the first options price is displayed next to the dropdown, works fine, when i change the select it should change the price to the price of the selected option, that works fine BUT it doesn't hide just the other price for that product, it hides it for every product.
My JS:
$(".build-box-list li").each(function() {
$(".variation", this).on("change", function() {
$(".price").hide();
$("#" + this.value).show();
});
});
How do I hide just the price in the specific product li and not every product, I did try $(".price", this).hide();
without success.
Thanks