onDblClick( )
Adds an event handler that runs when the element is double-clicked.
Description
An element receives a dblClick
event when a user double-clicks on the element
and releases.
When a user double-clicks an element, two click
events are fired
before a doubleClick
event is also fired.
You can also define an event handler using the Properties and Events panel.
Deprecation note: The $w parameter of event handlers is being deprecated. To get
a scoped selector for working with elements in repeater items, use the $w.at() function
and pass it the context property of the event parameter: $item = $w.at(event.context)
. To learn more, see
here.
Syntax
function onDblClick(handler: MouseEventHandler): Elementhandler: function MouseEventHandler(event: MouseEvent, $w: $w): void
onDblClick Parameters
NAME
TYPE
DESCRIPTION
The name of the function or the function expression to run when the element is clicked.
MouseEventHandler Parameters
NAME
TYPE
DESCRIPTION
Returns
This function does not return anything.
Return Type:
Related Content:
Was this helpful?
Get the ID of the element that was double-clicked
Code Example
1$w("#myElement").onDblClick( (event) => {2 let targetId = event.target.id; // "myElement"3} );