I have an array declared in a script:(我在脚本中声明了一个数组:)
var myArray = new Array("1", "2", "3", "4", "5" . . . . . "N");
I have a form which contains a drop down menu:(我有一个包含下拉菜单的表单:)
<form id="myForm">
<select id="selectNumber">
<option>Choose a number</option>
</select>
</form>
Using Javascript, how will I populate the rest of the drop down menu with the array values?(使用Javascript,我将如何使用数组值填充下拉菜单的其余部分?) So that the options will be "Choose a number", "1", "2", "3", "4", "5" .(这样选项将是“选择一个数字”,“1”,“2”,“3”,“4”,“5”。) .(。) .(。) .(。) .(。) "N"?(“N”?)
ask by user1296265 translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…