Define a click handler that you can use later:
var clickHandler = ('ontouchstart' in document.documentElement ? "touchstart" : "click"); $("a").bind(clickHandler, function(e) { alert("clicked or tapped. This button used: " + clickHandler); });
This will cause the device to be tapped without touching and the touch screen on the touch devices.
When this is said, I highly recommend using Quick Click instead and using regular click events. With the above solution, you will run βtouchstartβ on the links when you swipe it to scroll through the page, for example, which is not ideal.
curly_brackets
source share