jQuery dblclick() event
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