发生何种事件类型?
- <!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>