最简单的方法
把你要实现的内容 用html源代码组装好,
然后 document.XX.innerHTML=""

解决方案 »

  1.   

    用Ajax的DWR框架
    不清楚是动态创建<select>还是创建select的<option>
    给一个看看:
    <head>
    <script src="dwr/interface/JUser.js"></script>
    <script src="dwr/engine.js"></script>
    <script src="dwr/util.js"></script>
    <script type="text/javascript">

    function sload(){
    JUser.getData(id,getsls);//调用JUser业务类的获取将填充<select>的返回值为List的方法
    }
    function getsls(data){
    document.form1.firs.options.length=0;
                    document.form1.secs.options.length=0;
                    document.form1.ths.options.length=0;
    //如果是动态的就创建若干个
    //var oSel = document.createElement("SELECT");
    //oSel.id="firs";
    //.....
    for(var i=0;i<data.length;i++){
                                    //创建多个Option
    var option1=new Option(data[i].name,data[i].url);
                                    if(data[i].selectName==1)
    document.form1.firs.options.add(option1);
                                    else if(data[i].selectName==2)
                                    document.form1.secs.options.add(option1);
                                    else if(data[i].selectName==3)
                                    document.form1.ths.options.add(option1);
    }
    }
                     function getfAction(aurl){
                       document.forms[0].action="//"+aurl.value;
                       document.forms[0].submit();
        }
    </script>
    </head>        <body onload="sload()">
    <form name="form1">
    1:<select id="firs" onchange="getfAction(this)">
    </select>
    2:<select id="secs" onchange="getfAction(this)">
    </select>
                    3:<select id="ths" onchange="getfAction(this)">
    </select>
    </form>
    </body>