如题,求高手解答?

解决方案 »

  1.   

    代码?
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
        <title>event.html</title>

        <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
        <meta http-equiv="description" content="this is my page">
        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
        <script type="text/javascript">
         function test(e) {
         e = event || window.event;
         if (e.keyCode == 13) {
         alert("your press enter key");
         }
         }
        </script>  </head>
      
      <body>
        <input id="btn" type="text" value="click" onkeyup="test(event)"/>
      </body>
    </html>
      

  2.   

    键盘捕捉 一般是 keypress  keydown keyup
    在各个浏览器中兼容性各不一样 
    网上已经有这个很全文章了
    http://hi.baidu.com/%D3%F0%E9%E4%C8%CA/blog/item/2922c9e9bed5b238b90e2d6b.html