I am struggling with a jQuery issue involving multiple container elements with the class "product-sizes". Each container contains a select option for choosing between inches and centimeters, which triggers the corresponding table display. The problem arises when there are two or more containers - the tables don't switch properly between inch and cm, and the second container doesn't display the table at all.
If anyone can provide guidance on how to fix this issue or address it using vanilla JS, I would greatly appreciate it.
$('.product-sizes').each(function () {
$(this).find('.measurement').on('change', function () {
$('.product-sizes__tab').hide();
$('.product-sizes__tab').eq($(this).val()).show();
}).trigger('change');
});
...
</script>