If you try this snippet on desktop, everything works.
Whenever you try it on iPad, it won't do anything.
$('body').on('click', '#click', function() {
alert("This alert won't work on iPad");
});
div {
font-size: 24px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="click">Click here</div>
Simple .click()
handler works, but it isn't what I want. The same applies for .delegate();
and .live()
Is it a bug or something?
on
was added to jquery 1.7.2 in November 2011 and hasn't made it to jquery mobile yet. – Pennsylvanianon()
. – Gourdeclick
as the name of yourid
is the root problem? (I have no way to test it) Maybe it's not a reserved word, but personally, I'd stay away from naming things in this fashion. – Gourde