编辑下面的代码:【加编码】
<html> <head> <script> function whichButton(event) { alert(event.keyCode); } </script> </head> <body onkeyup="whichButton(event)"> <p><b>Note:</b> Make sure the right frame has focus when trying this example!</p> <p>Press a key on your keyboard. An alert box will alert the keycode of the key.</p> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂