解决方案 »

  1.   


    $("select:selected").text();//用JQuery
      

  2.   

    这个应该用onkeypress去实现然后获取空格键键位码判断键位码是不是空格键然后在获取select下面option值就ok了
      

  3.   

    <!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>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <script>
    function spaceEvt(e){
    var evt=e||window.event;
    if(evt.keyCode=='32')
    alert(document.getElementById("sel").options[document.getElementById("sel").options.selectedIndex].text);
    }
    </script>
    </head>
    <body onkeyup="spaceEvt(event)">
    <select id="sel" style="width:100px;" size="15">
    <option value="11">1</option>
        <option value="22">2</option>
    <option value="33">3</option>
    <option value="44">4</option>
    <option value="55">5</option>
    <option value="66" selected="selected">6</option>
        <option value="77">7</option>
    <option value="88">8</option>
    <option value="99">9</option>
    <option value="10">10</option>
    </select></body>
    </html>写一个小例子挺简单的!
      

  4.   

    自己解决了,不过还是要谢谢你们了:
    //JS空格事件选取Select项<br />
    <br />
    <select onkeypress="changeChars(window.event.keyCode,this,'otherFocusId')">
        <option value="baoma">宝马</option>
        <option value="benchi">奔驰</option>
    </select>
    <script type="text/javascript">
        function changeChars(code, obj, otherFocusId) {
            if (code == 32) {
                document.getElementById("" + otherFocusId + "").focus();
            }
            document.getElementById("" + otherFocusId + "").value = obj.value;
        }
    </script>
    <input type="text" id="otherFocusId" />