fmpq.com
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Fmpq教程(fmpq.com)</title> <script> function isKeyPressed(event){ if (event.shiftKey==1){ alert(" shift 键被按下!"); } else{ alert(" shift 键没被按下!"); } } </script> </head> <body onmousedown="isKeyPressed(event)"> <p>点击该段落,弹窗会提示是否按下 shift 键。</p> </body> </html>
运行结果