I made a select tag in html and gave every option different values like this
<option class="op" value="3"></option>
<option class="op" value="4"></option>
<option class="op" value="5"></option>
I am trying to put this values in an array using js.
First I call the class and store in var = values
then using the for loop I tried to put the values in an array but I get this error (i.value is not iterable)
var values = [...document.getElementsByClassName('op')];
for (i = 0; i< values.length; i++) {
var originalValues = [...i.value];
console.log(originalValues)
}
expected output: originalValues = [1,2,3,...]