I have a dropdown list, and after I select an item it should list the products alphabetical order or by price.
In firefox it's working correctly, but in chrome the option.addEventListener is not triggered.
const sortedBy = Array.from(document.querySelector('.order').options);
sortedBy.forEach(option => {
option.addEventListener('click', () => {
switch (parseInt(option.value)) {
case 0:
newOrderHtml(priceLowToHigh);
saleCheck();
break;
case 1:
newOrderHtml(priceHighToLow);
saleCheck();
break;
case 2:
newOrderHtml(abcIncrease);
saleCheck();
break;
case 3:
newOrderHtml(abcDecrease);
saleCheck();
break;
default:
newOrderHtml(priceLowToHigh);
saleCheck();
}
})
})