shift 键被按了吗?
- <html>
- <head>
- <script type="text/javascript">
- function isKeyPressed(event)
- {
- if (event.shiftKey==1)
- {
- alert("The shift key was pressed!")
- }
- else
- {
- alert("The shift key was NOT pressed!")
- }
- }
- </script>
- </head>
- <body onmousedown="isKeyPressed(event)">
- <p>在文档中点击某个位置。消息框会告诉你是否按下了 shift 键。</p>
- </body>
- </html>