jQuery Tutorial Tutorials - jQuery .dblclick() method

jQuery .dblclick() method

The .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.

jQuery .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.

jQuery .dblclick() method Example

Call .dblclick() without an argument will trigger a dblclick event.

example

Trigger the dblclick event on all paragraphs:

$("p").dblclick();

jQuery .dblclick([eventData,]handler) method Example

example

Double 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