87,993
社区成员
发帖
与我相关
我的任务
分享
function ld() {
var from = document.getElementById('from');
var city = document.getElementById('city');
var arr = [
[],
['1'],
['1', '2'],
['1', '2', '3']
];
city.options.length = 0;
if (parseInt(from.value, 10) < 0) {
return;
}
for (var i = 0, len = arr[from.value].length; i < len; i++) {
city.options.add(new Option(arr[from.value][i],i));
}
}