Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript array from datalist

var options = document.getElementById('estados').getElementsByTagName('option');
var optionVals = [], i = 0;

for (i; i < options.length; i += 1) {
  optionVals.push(options[i].value);
}

console.log(optionVals);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #array #datalist
ADD COMMENT
Topic
Name
7+3 =