W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<!DOCTYPE html> <html> <head> <script> function getEventType(event) { document.getElementById("demo").innerHTML = event.type; } </script> </head> <body> <img src ="/i/eg_planets.jpg" alt="Planets" onmousedown="getEventType(event)" /> <p>点击上面的图片,会提示您触发了哪种类型的事件。</p> <p id="demo"></p> </body> </html>