<select name=test></select>
<script>
str="北京,东京,上海"
for(i in str.split(","))
test.options[test.options.length]=new Option(str.split(",")[i])
</script>

解决方案 »

  1.   

    <html>
    <body>
    <select id='po' style='width:60'>
    </select>
    <input type=button onclick="tt()">
    <script>
    function tt()
    {
    var aa= "±±&frac34;&copy;,&Eacute;&Iuml;&ordm;&pound;";
    var bb = aa.split(",");
    for(var i = 0;i < bb.length;i++)
    {
    debugger;
     var oE = document.createElement("<OPTION>");
     
     document.all('po').appendChild(oE);
     oE.text = bb[i];
    }
    }
    </script>
    </body>
    </html>
      

  2.   

    <html>
    <body>
    <select id='po' style='width:60'>
    </select>
    <input type=button onclick="tt()">
    <script>
    function tt()
    {
    var aa= "北京,上海";
    var bb = aa.split(",");
    for(var i = 0;i < bb.length;i++)
    {
    debugger;
     var oE = document.createElement("<OPTION>");
     
     document.all('po').appendChild(oE);
     oE.text = bb[i];
    }
    }
    </script>
    </body>
    </html>