Possible Duplicate:
JavaScript - populate drop down list with array
I have following select
box,
<select name="supplier" id="supplier"><option></option></select>
I want to set the values of this select
box using Javascript
. The Javascript
variable may be a String
or an Array
. That means if its a String
then there will be only one option in select
box. And if it is an array the select
box should contain multiple options
. Someone please help me find the solution. Thanks in advance....
I have tried
document.getElementById('supplier').value="Option 1";
but its not working