87,910
社区成员
发帖
与我相关
我的任务
分享
<select id="city">
</select>
for (var i = 0; i < _cityArray.length; i++) {
var oOption = document.createElement("Option");
oOption.text = _cityArray[i];
oOption.value = i;
document.getElementById("city").add(oOption);
}
while (document.getElementById("city").options.length > 0) {
document.getElementById("city").options.remove(0);
}