Made a list in html and gave every option a value of numbers (0,1,2,...) and gave all the options the same class 'op' and then I want to save this values in an array in javascript but my code doesn't seem to work.
output should be [0,1,2,3,...] instead nothing happens
let valuesfromhtml = document.getElementsByClassName('op').value;
function test(value){ for (i=0 ; i < valuesfromhtml ; i++){
let valuesofnames = [];
valuesofnames.push(valuesfromhtml);
console.log(valuesofnames)}
}