datalist doesnt work if input has array name code example
Example 1: create javascript array from datalist dynamically
alert(my_list.options[5].value);
Example 2: 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);