安科网
源代码:
点击运行
<!DOCTYPE html> <html> <head> <script> function isKeyPressed(event) { if (event.shiftKey==1) { alert(" shift 键被按下!"); } else { alert(" shift 键没被按下!"); } } </script> </head> <body onmousedown="isKeyPressed(event)"> <p>点击该段落,尝试按下或者不按下shift 键的效果。</p> </body> </html>
运行结果
Copyright © 2013 - 2019 Ancii.com All Rights Reserved
京ICP备18063983号-5
京公网安备11010802014868号