Pajar Fathurrahman Pajar Fathurrahman - 1 year ago 100
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?

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download