I am working on a phonegap project. I need to implement a long press event. How can we detect long press on a image/button using JavaScript?
$('#target').mousedown(function() {
alert('Handler for .mousedown() called.');
//start a timer
});
$('#target').mouseup(function() {
alert('Handler for .mouseup() called.');
//stop the timer and decide on long click
});