案例:javascript案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<html>
2
<head>
3
<script type="text/javascript">
4
function whichButton(event)
5
{
6
alert(event.keyCode)
7
}
8
9
</script>
10
</head>
11
12
<body onkeyup="whichButton(event)">
13
<p><b>注释:</b>在测试这个例子时,要确保右侧的框架获得了焦点。</p>
14
<p>在键盘上按一个键。消息框会提示出该按键的 unicode。</p>
15
</body>
16
17
</html>
18