利用js实现键盘的特效(onkeydown())
<html><head>
<meta charset="utf-8"/>
<script>
function ondown(e){
switch(e.keyCode){
case 37:alert("左"); break;
case 38:alert("上"); break;
case 39:alert("右"); break;
case 40:alert("下"); break;
}
}
</script>
</head>
<body onkeydown="ondown(event)">
</body>
</html>
补充:web前端 , JavaScript ,