Long press function


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


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.