document.all.r0.options[document.all.r0.options.length] = new Option("v","t")

解决方案 »

  1.   

    http://www.cnblogs.com/goody9807/archive/2005/07/05/186602.html
      

  2.   

    var op = document.createElement("OPTION");
    select .options.add(op);
    op.innerText = temp;
    op.value = i;
      

  3.   

    <script defer>
    function fnc(){
    re_name.value=r0.options[r0.selectedIndex].text
    }function fncAdd(){
    var txt=document.all.re_name.value;
    if (txt.length>0 && r00.innerText=="")
    {r00.innerHTML  += txt;
    haha.style.display="none";}
    }
    </script><input type=text id=re_name style="width:95px;height:20px;font-size:10pt;" value="">
    <span style="width:20px;border:0px solid red;">
        <select id="r0" style="margin-left:-100px;width:118px; background-color:#FFEEEE;" 
                           onChange="fnc();">
            
            <option value="1" id="r01">111111</option> 
            <option value="2" id="r02">222222</option> 
            <option value="3" id="r03">333333</option>
            <option value="0" id="r00"></option>
        </select> 
    </span> 
    <span id=haha><input type="button" value="add a new" onclick="fncAdd();"></span>
      

  4.   

    var item=document.createElement("option");
    item.text="fdsafdsa";
    slts.add(item);