jQuery .on() and .delegate() doesn't work on iPad

Martin. picture Martin. · Apr 15, 2012 · Viewed 16.1k times · Source

If you try this snippet on desktop, everything works.
Whenever you try it on iPad, it won't do anything.

Simple .click() handler works, but it isn't what I want. The same applies for .delegate(); and .live()

Is it a bug or something?

Answer

mddw picture mddw · Apr 15, 2012

It's a Safari mobile bug/feature : click events won't bubble all the way up to body.

Adding onclick="" is a known workaround, but IMHO it's easier to attach your listener on a first child of <body>.

See: http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html