本帖最后由 Miconioides 于 2010-09-19 00:02:53 编辑

解决方案 »

  1.   

    不用那么麻烦的啊, lz. 可以控制selectedIndex<html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>mydiv</title>
    <script type="text/javascript" src="jquery/jquery.js"></script>
    <script language="javascript">
    function Change(){
    //document.getElementById("Select").selectedIndex = 2;
    $("#Select").attr('selectedIndex', 2);
    }
    </script>
    </head>
    <body>
    <select id="Select">
    <option>1</option>
    <option>2</option>
    <option>3</option>
    <option>4</option>
    <option>5</option>
    </select>

    <button onclick="Change()">Change</button>
    </body>
    </html>
      

  2.   

    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
            <title>mydiv</title>
            <script type="text/javascript" src="jquery/jquery.js"></script>
            <script language="javascript">
                function Change(){
                    //document.getElementById("Select").selectedIndex = 2;
                    $("#Select").val(3);
                }
            </script>    
        </head>
        <body>
            <select id="Select">
                <option>1</option>
                <option>2</option>
                <option>3</option>
                <option>4</option>
                <option>5</option>
            </select>
            
            <button onclick="Change()">Change</button>
        </body>
    </html>