<script>
a=""
function st()
{
a+=String.fromCharCode(event.keyCode)
}
</script>
<body onclick="alert(a)" onkeydown="st()">
点鼠标显示输入的字符

解决方案 »

  1.   

    那怎么用键盘来改变select菜单的selectIndex属性?
    谢谢了!
      

  2.   

    <body onkeydown=change()>
    <select id=a1>
    <option>1</option>
    <option>2</option>
    <option>3</option>
    <option>4</option>
    <option>5</option>
    <option>6</option>
    <option>7</option>
    <option>8</option>
    <option>9</option>
    <option>10</option>
    </select>
    <script>
    function change(){
     if(event.keyCode==38)
        if(a1.selectedIndex>0)
          a1.selectedIndex--
     if(event.keyCode==40)
        if(a1.selectedIndex<8)
          a1.selectedIndex++
    }
    </script>