javascript array from datalist

Solutions on MaxInterview for javascript array from datalist by the best coders in the world

showing results for - "javascript array from datalist"
Simona
26 Nov 2020
1var options = document.getElementById('estados').getElementsByTagName('option');
2var optionVals = [], i = 0;
3
4for (i; i < options.length; i += 1) {
5  optionVals.push(options[i].value);
6}
7
8console.log(optionVals);
9
Amelie
03 Aug 2020
1var my_list=document.getElementById("months");
2my_list.innerHTML = str;
Lucille
01 Aug 2016
1<input name="month" list="months" >
2<datalist id="months" >
3</datalist>
Francisco
14 Mar 2016
1alert(my_list.options[5].value);