document.getElementById("option id").options[document.getElementById("option id").length] = new Option('new text','new value');

解决方案 »

  1.   

    或则
    var opt = document.createElement('OPTION');
    opt.value = value;
    opt.text = text;
    document.getElementById("option id").options.add(opt, document.getElementById("option id").length);
      

  2.   

    回LS。最开始我是把一个option作为末尾插入的。然后对这个下拉表的每项可以编辑,编辑时其实是对插入末尾的那个option进行的编辑。然后编辑之后,那个末尾的opt在显示时就排序到上面了。
    比如下拉选项
    1
    2
    3
    4
    ?(末尾的option,预留用作修改前面4个option)然后可以对前面的4个option修改,修改的值存到末尾的option中,前面4个option还是保持value1,2,3,4.就是最后这个保存刚刚修改的值。结果,在网页显示时,修改的值和原来那4个值(1,2,3,4)被排序了。- -。怎么让修改的值还在最后呢?