How To Use ondblclick Event Example Using JavaScript?

Nov 23, 2021 . Admin



Hello Friends,

Now let's see example of how to use ondblclick event example. We will check how to use ondblclick event. This is a short guide on use ondblclick event in javascript. Here you will learn how to use javascript ondblclick event. Let's get started with how to use ondblclick event in javascript.

Here i will give you many example how to use ondblclick event using javascript.

Example : 1
<!DOCTYPE html>
<html>
    <head>
        <title>How To Use ondblclick Event Example Using JavaScript? - MyWebtuts.com</title>
    </head>
    <body>
        <h3>How To Use ondblclick Event Example Using JavaScript? - MyWebtuts.com</h3>
        <h1 id = "a1" ondblclick = "test()">MyWebtuts.com</h1>
        <h2> Double Click the text "MyWebtuts.com" to see the effect. </h2>
        <script>
            function test() {
                document.getElementById("a1").innerHTML = " Welcome to the MyWebtuts.com  ";
            }
        </script>
    </body>
</html>  
Output :
Welcome to the MyWebtuts.com
Double Click the text "MyWebtuts.com" to see the effect.
Example : 2
<!DOCTYPE html>
<html>
    <head>
        <title>How To Use ondblclick Event Example Using JavaScript? - MyWebtuts.com</title>
    </head>
    <body>
        <h3>How To Use ondblclick Event Example Using JavaScript? - MyWebtuts.com</h3>
        <h1 id = "c1">MyWebtuts.com</h1>
        <h2>Double Click the text "MyWebtuts.com" to see the effect.</h2>
        <script>
            document.getElementById("c1").ondblclick = function(){ test() };
            function test() {
                document.getElementById("c1").innerHTML = " Welcome to the MyWebtuts.com ";
            }
        </script>
    </body>
</html>  
Output :
Welcome to the MyWebtuts.com
Double Click the text "MyWebtuts.com" to see the effect.

It will help you...

#Javascript