jQuery dblclick()Event

jQuery 事件方法jQuery Event Methods

Examples

Alert text when double-clicking a <p> element:

$("p").dblclick(function(){ alert("This paragraph is double-clicked."); });

Try it yourself »

Definition and Usage

The dblclick event is triggered when an element is double-clicked.

The dblclick() method triggers the dblclick event, or specifies a function to run when the dblclick event occurs.

Tip:The dblclick event also triggers a click event. If both events are applied to the same element, problems will occur.


Syntax

Trigger the dblclick event on the selected element:

$(selector).dblclick() Try it yourself

Add a function to the dblclick event:

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

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


jQuery 事件方法jQuery Event Methods

Other Extensions