W3School TIY
编辑您的代码:
<html> <head> <script type="text/javascript"> function getEventType(event) { alert(event.type); } </script> </head> <body onmousedown="getEventType(event)"> <p>在文档中点击某个位置。消息框会提示出被触发的事件的类型。</p> </body> </html>
查看结果: