【发布时间】:2016-11-26 17:59:42
【问题描述】:
这里是新手 JS,我需要从 10 个城市的数组中填充一个下拉列表,但我无法让任何代码工作。
<select id="selectCity">
<option>Choose a City</option>
</select>
var select = document.getElementById('selectCity');
var options = ["Winthrop","Revere","Malden","East Boston","Medford","Somerville","South Boston","Quincy","Malden","Weymouth"];
//what code will work in this loop below???
for(var i = 0; i < options.length; i++) {
}
【问题讨论】:
标签: javascript