What is ondblclick event in JavaScript?


Use the ondblclick event to generate an event on double click.

Example

You can try to run the following code to learn how to work with ondblclick event in JavaScript −

<html>
   <head>
      <script>
         <!--
            function sayHello() {
               alert("Hello World")
            }
         //-->
      </script>
   </head>
   <body>
      <p ondblclick="sayHello()">Double Click me</p>
   </body>
</html>

Updated on: 19-Jun-2020

257 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements