http://www.csdn.net/Expert/topicview.asp?id=797931

解决方案 »

  1.   

    var input_node = document.createElement("<input type=radio>")
      

  2.   

    IE和NS通用的方法:
    <form name=f>
    <select name=s></selct>
    <input type=button onclick="a()" value=add>
    </form>
    <script>
    var i=0
    function a()
    {
    b=document.f.s
    var opt=new Option("text"+ i,"value"+i,true,true)
    b.options[b.options.length] = opt
    i++
    }
    </script>
      

  3.   

    <select id=demo></select>
    <script>
    var option_node = document.createElement("OPTION")
    option_node.innerText="hehe"
    demo.appendChild(option_node)
    </script>
      

  4.   

    <script>
    var _obj=document.all("test");
    var _o=document.createElement("Option");
    _o.text="text";
    _o.value="1";
    _obj.add(_o);
    </script>
      

  5.   

    用javascript实现,the_select为操作的select框,the_array为一个数组,用来赋值,其实不用也可以。function setOptionText(the_select, the_array)
    {
    the_select.options.length = the_array.length-1;
    for (loop=0; loop < the_array.length-1; loop++)
    {         
    the_select.options[loop].text = the_array[loop];
    the_select.options[loop].value = the_array[loop];
    }
    }