jQuery Dblclick Event

Sunday, June 17, 2012

The jQuery event dblclick() method occurs when an element is double clicked. The dblclick() method triggers the dblclick event, or specifies a function to run when a dblclick event occurs. You should note that it is not recommended to apply the click and dblclick event to the same element. If both are applied, unexpected results can occur.



functionFunction to run when the event(s) occur

Basic Example

In the following jQuery example, the dblclick() method specifies that a function should run when the click event occurs. In this example, the div element will be shown or hidden as the mouse icon is double-clicked. Try it yourself, by double-clicking the mouse icon. You can copy and edit the jQuery code using our online HTML editor.

$("#mouse").dblclick(function () {

Double-Click the mouse icon to toggle this display!

Did you find the page informational and useful? Share it using one of your favorite social sites.

Recommended Books & Training Resources

JavaScript and jQuery: The Missing Manual Pro jQuery Professional jQuery