<html>
<script language="javascript">
function test()
{
if(event.keyCode==13)
{
alert("你按了回车")
}
if(event.shiftKey==true)
{
alert("你按了shift")
}
if(event.ctrlKey==true)
{
alert("你按了ctrl")
}
if(event.altKey==true)
{
alert("你按了alt")
}
}
</script>
<body onkeydown="test()">
Please type "enter"key "shift"key "ctrl"key "alt"key.
</body >
</html>
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/liuliang1232005/archive/2008/12/05/3454276.aspx
<script language="javascript">
function test()
{
if(event.keyCode==13)
{
alert("你按了回车")
}
if(event.shiftKey==true)
{
alert("你按了shift")
}
if(event.ctrlKey==true)
{
alert("你按了ctrl")
}
if(event.altKey==true)
{
alert("你按了alt")
}
}
</script>
<body onkeydown="test()">
Please type "enter"key "shift"key "ctrl"key "alt"key.
</body >
</html>
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/liuliang1232005/archive/2008/12/05/3454276.aspx
转载无需注明出处,多多交流 ,欢迎访问我的博客:http://www.cnblogs.com/niuniu