Long press function

Hello

I want to use one button for both undo and reset.
Is there long press capture mechanism?

Thanks
Waj

Use the onmousedown event (instead of onclick) to record the time the mouse was pushed down.

Add an onmouseup event function which can check when onmousedown happened and take appropriate action.

On a device, use the ontouchdown event.