I have a problem validating the indexes of the selected options in a select since the event only runs in the select utlimo, since the selected index == 0, it is as if the for would not work
the button must be activated only if both select are in an index other than 0 but when selecting index 0 in select number 1 and index 1 in select 2 the button is still active.
let btn = document.getElementById("btn");
let list = document.getElementsByClassName("options");
btn.disabled = true;
for (item of list){
item.addEventListener('mouseout', function(){
if(item.options.selectedIndex === 0){
btn.disabled = true
}else if (item.options.selectedIndex !== 0){
btn.disabled = false
}
}, false)
}
<select class="options"name="" id="">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<select class="options"name="" id="">
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
</select>
<button id="btn">Submit</button>