js循环select问题
function showData(){if(xmlHttp.readyState==4){
if(xmlHttp.status==200){
temp = new Array;
temp = xmlHttp.responseText.split("-");
chid = new Array;
chid = temp[0].split("|");
chmi = new Array;
chmi = temp[1].split("|");
for(i=0;i<chid.length;i++){
document.all("city").options[0] = new Option(chmi[i],chid[i]);
}
}}} ////上面是js代码
/////////////////////////////////////////////////////////////////////////////
<select name='city' id='city'></select> ////html代码
为什么不循环输出多个选项,而是吧所有内容的都循环到一个选项上了?