Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery dblclick() method

jQuery dblclick() event

jQuery event methods jQuery event methods

Example

Double-click

element, alert text:

$

(

"

p

"

)

.

dblclick

(

function

(

)

{

alert

(

"

This paragraph is double-clicked.

"

)

;

}

)

;

Try it »


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 a dblclick event occurs.

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


Syntax

Trigger the dblclick event of the selected element:

$(

selector

).dblclick()

Try it

Add a function to the dblclick event:

$(

selector

).dblclick(

function

)

Try it

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

jQuery event methods jQuery event methods