js中使用for循环生成select下拉框
yearSel是select的id
for(var i=2000;i<2031;i++){
var newOption = document.createElement("option");
newOption.text=i+"年";
newOption.value=i;
document.getElementById("yearSel").add(newOption);
}