Javascript examples for DOM Event:addEventListener
The ondblclick event occurs when the user double-clicks on an element.
Bubbles | Yes |
---|---|
Cancelable | Yes |
Event type: | MouseEvent |
Supported HTML tags: | All HTML elements, EXCEPT: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style>, and <title>. |
<!DOCTYPE html> <html> <body> <p id="demo">Double-click me.</p> <script> document.getElementById("demo").addEventListener("dblclick", myFunction); function myFunction() {/*from www. ja va2 s. co m*/ document.getElementById("demo").innerHTML = "I was double-clicked!"; } </script> </body> </html>