Introduction:

  • In this article we will explain how call double click event of html HTML element using jquery or What is dblclick() method in jquery or why use dblclick() method in jquery with example.

 

Description:

The jQuery dblclick() method is used to attaches an event handler function to an HTML element. this function is executed when the user double clicks on the HTML element.

Let’s see simple Example:

jQuery  dblclick() Method

 

In this example when we double clicks on anchor tag elements show an alert message.

 

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Example of jQuery </title>
    <script src="Scripts/jquery-1.8.2.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("a").dblclick(function () {
                alert("you Double clicked it.");
            });
        });
    </script>
</head>
<body>
    <div style="text-align:center; margin-top:150px">
       <a href="#">Double click here</a>
     </div>    
</body>
</html>

OutPut:


double click event in jquery


In above example when you double click on “Double click here” link then execute Double click event and show alert message. 

 

I hope this article will help to you.

0 comments


Leave a comment

Make sure you enter the (*) required information where indicated. HTML code is not allowed.

You may also like