Example

Hide or show a p element when a button is double-clicked:

$("button").dblclick(function(){
  $("p").slideToggle();
});

Try it yourself »

Definition and Usage

The dblclick event 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.

Tip: The dblclick and click events can cause problems if they are applied to the same element.


Trigger the dblclick Event

Trigger the dblclick event for the selected elements.

Syntax

$(selector).dblclick()
Try it yourself »


Bind a Function to the dblclick Event

Specifies a function to run when the dblclick event occurs for the selected elements.

Syntax

$(selector).dblclick(function)
Try it yourself »

Parameter Description
function Optional. Specifies the function to run when the dblclick event occurs