Get all values ​​from a drop-down list to a table using Javascript

advertisements

how can I get the values of dropdownlist to an array?


var ddlArray= new Array();
var ddl = document.getElementById('ddl');
for (i = 0; i < ddl.options.length; i++) {
   ddlArray[i] = ddl .options[i].value;
}

http://jsfiddle.net/2vtmP/