Take the 2-minute tour ×

I have a simple click event attached to a number of anchors on my web app.

$('a.heading').live("click", function(e) {
   //do my stuff

It's not rocket science. However on my iPhone the click doesn't register. It would appear it uses the touch handler for iPhone (iPad, Android etc are all fine).

I've seen a couple of tutorials but cannot seem to get my head around it. Is there not a one liner that I can use that jQuery is so usually good at?

Thanks in advance.

share|improve this question
iPhone uses touch not click :( stackoverflow.com/questions/3705937/… –  benhowdle89 Jul 26 '11 at 10:48
Similar Question : stackoverflow.com/questions/671498/… –  diEcho Jul 26 '11 at 10:50
add comment

1 Answer

up vote 5 down vote accepted

This did the trick:

var userAgent = navigator.userAgent.toLowerCase();
clickEvent = isiPhone ? 'tap' : 'click';
share|improve this answer
looks hacky. Looks like you're aiming at a moving target. –  3Dom Feb 3 '13 at 8:17
add comment

Your Answer


