案例:jQuery案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<html>
2
<head>
3
<script type="text/javascript" src="/js/jquery.js"></script>
4
<script type="text/javascript">
5
$(document).ready(function(){
6
  $("input").keydown(function(event){ 
7
    $("div").html("Key: " + event.which);
8
  });
9
});
10
</script>
11
</head>
12
<body>
13
14
请随意键入一些字符:<input type="text" />
15
<p>当您在上面的框中键入文本时,下面的 div 会显示键位序号。</p>
16
<div />
17
18
</body>
19
</html>
20