.dblclick() methodThe .dblclick() method in jQuery is used to bind an event handler to the dblclick event on the element
It is used to trigger an dblclick event on an element.
.dblclick() method Syntax.dblclick() .dblclick(handler) .dblclick(eventData,handler)
| Parameter | Type | Description |
|---|---|---|
handler |
Function | A function to execute when the dblclick is triggered on the matched element. |
eventData |
Anything | Additional data passed to the event handler. |
.dblclick() method ExampleCall .dblclick() without an argument will trigger a dblclick event.
Trigger the dblclick event on all paragraphs:
$("p").dblclick();
.dblclick([eventData,]handler) method ExampleDouble click to toggle background color.
$("#block").dblclick( function () {
$(this).toggleClass( "highlight" );
// return `false` to prevent the default right click action
return false;
}); Date:2019-08-30 00:00:26 From:www.Lautturi.com author:Lautturi
