I have an array which contains a list of value retrieved from a web service, I then need to iterate through this array and populate a drop-down list with the value within the array, but I am unable to get this working. I have written the below javascript to populate the drop-down list.
for(var i = 0; i<payee.length; i++) { $($('#q1 option')[i]).text(payee[i]); }
I have an array call 'payee' which contains at least 2 value, but for some reason the above code only populates the first value into the drop-down list and ignores the rest. Does anyone have any idea? Thanks.