jQuery Event - dblclick() Method

Example

Hide or show elements when the button is double-clicked:

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

Try It Yourself

Definition and Usage

A dblclick event occurs when an element is double-clicked.

A click event occurs when the mouse pointer is over an element and the left mouse button is pressed and released.

A double click event occurs when a click event happens twice in a short period of time.

The dblclick() method triggers a dblclick event or specifies a function to be executed when a dblclick event occurs.

Tip:Applying both dblclick and click events to the same element may cause issues.

Triggers a dblclick event

Syntax

$(selector).dblclick()

Try It Yourself

Binds a function to the dblclick event

Syntax

$(selector).dblclick(function)
Parameters Description
function Optional. Specifies a function to be executed when a dblclick event occurs.

Try It Yourself