document.formName.selectedName.options[index]=new Option(text,value);
数据库中的值可以先读到js数组中好方便操作

解决方案 »

  1.   

    for (var i = 0; i < document.formName.selectedName.options.length; i++) {
        document.formName.selectedName.options[i]=new Option(text,value);
    }
      

  2.   

    //看看下面的代码,应该可以帮你解决问题!
    var allotherdepuser = new Array( new Array("csdn","www.csdn.net")
                                     new Array("pconline","www.pconline.com.cn")
                                    );
    for (var i=0;i<allotherdepuser.length;i++)
    {
           var oOption = document.createElement("OPTION");
           document.all("webs").options.add(oOption);
           oOption.innerText = allotherdepuser[i][0];
           oOption.Value = allotherdepuser[i][1];
    }
      

  3.   

    谢谢各位。 如果用数组是可以。用VECTOR可以吗?