jquery which事件 语法
作用:which 属性指示按了哪个键或按钮。大理石平台精度等级
语法:event.whic
参数:
参数 | 描述 |
event | 必需。规定要检查的事件。这个 event 参数来自事件绑定函数。 |
jquery which事件 示例
<html> <head> <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("input").keydown(function(event){ $("div").html("Key: " + event.which); }); }); </script> </head> <body> 请随意键入一些字符:<input type="text" /> <p>当您在上面的框中键入文本时,下面的 div 会显示键位序号。</p> <div /> </body> </html>