本帖最后由 dongzhan7 于 2010-01-21 22:26:30 编辑

解决方案 »

  1.   

    <a href="javascript:void(0)" onclick="goto()" />
    function goto(){
       var ddl = document.getElementById("ddl");
        var id = ddl.options[ddl.selectedIndex].text;
        //var href = document.getElementById("abc").href;
        //href=href+id;
        //document.getElementById("abc").href=href; 
        var href="url?a="+id;
        window.location = href;  
    }
      

  2.   

    那你每次改变ddl值后
    var prehref = "Http://...url?id=";
    var idvalue = document.getElementById("ddl").value;
    document.getElementById("abc").href='"prehref""+idvalue+"';试试,不知道对不对。
      

  3.   

    在下拉列表ddl的onchange事件中,执行你的js代码,改变a 的href
      

  4.   


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Untitled Page</title>    <script language="javascript">
            function Go()
            {
                document.location.href = "your_address?your_parameter=" + document.getElementById("mySelect").value;
            }
        </script></head>
    <body>
        <form id="form1" runat="server">
        <div>
            <select id="mySelect">
                <option value="1">Go home</option>
                <option value="2">Call girl friend</option>
            </select>
        </div>
        <div>
            <input type="button" value="Click me" onclick="Go();" />
        </div>
        </form>
    </body>
    </html>
      

  5.   

    var href = document.getElementById("abc").href.split('?')[0]+'a=';
      

  6.   

    <script>
    function go(){
    var ddl = document.getElementById("ddl"); 
        var id = ddl.options[ddl.selectedIndex].text;
    var url="你的url的前缀";
    window.location.href=url+id;
    }
    </script>
    <a onclick="go()">