Pajar Fathurrahman Pajar Fathurrahman - 3 months ago 11
jQuery Question

Double click / tap event cross browser and device

I try use dblclick event like this

$(element).on('dblclick', function(){

but just working for double click not for double tap.
I need some jquery/javascript function for handle double click/tap event, i need for touchscreen laptop, someone can help me with a snippet or anything?


Using jQuery:

This should get you started:

var divdbl = $("div:first");
divdbl.dblclick(function() {
div {
  background: blue;
  color: white;
  height: 100px;
  width: 150px;

div.dbl {
  background: yellow;
  color: black;
<!doctype html>
<html lang="en">
  <script src=""></script>
<span>Double click the block</span>

More info here.