var clicked_count = 0;
document.addEventListener('ontouchstart' in document ? 'touchstart' : 'mousedown', function(e) {
clicked_count++;
setTimeout(function () {
// Reset the count if you do not click in 500ms
clicked_count = 0;
}, 500);
if (clicked_count > 1) {
// Double-clicked event can trigger script execution here.
clicked_count = 0;
}
}, false);