jQuery dblclick() function fires when an HTML element is double clicked. This method will attach an event handler to the double click event. We can do desired manipulations on the selected HTML element using the jQuery double click event handler.

jQuery double click

jQuery double click event syntax:

In this, dblclick() method is used without an argument.

The handler could be any function that is executed each time the double click event is fired.

jQuery Double Click Example

Following example demonstrates the use of jQuery dblclick() event method.

In this example, you can see that dblclick() method is triggered when you double click on the <div> element.

In this method, we pass a handler to change the background color of the <div> element.

The toggleClass() method toggle between the two CSS class defined in the above code. The toggleClass() method executes each time when we double click on the element.

You can see above jQuery example in action by visiting below URL.

jQuery Double Click Demo

By admin

Leave a Reply