Мне необходимо, чтобы при выборе двух состояний выполнялся код (отображался блок)
Есть такой код, он отлично работает если выбран одно из значений option, но при выборе двух он не работает, помогите
з.ы. я так понимаю value option при выборе всегда одно и оно просто сменяется и не может принять 2 состояния
document.addEventListener("DOMContentLoaded", () => {
const colorSelect = document.querySelector('.hasCustomSelect[name="features[13]"] option').value
const plugSelect = document.querySelector('.hasCustomSelect[name="features[12]"] option').value
const typeSelect = document.querySelectorAll('.hasCustomSelect option')
typeSelect.forEach(item => {
item.addEventListener('change', function(e) { //click
let text = this.value
if (text == 42) { //&& text == 1
console.log(item);
document.getElementById('sometable').style.display = 'block'
} else {
document.getElementById('sometable').style.display = 'none'
}
})
})
})