I noticed that
$(\"body\").on(\"click\", \"#id\", function(event) {...
does not work on iOS while
$(\"#id\").on(\"click\",
Try as follows once:
$(document).on("click touchstart", "#id", function(event) {...
If you want to add click and not use touch events you can do this (although it does involve agent sniffing):
// Check if it is iOS
var isiOS = (navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false);
if(isiOS === true) {
// Store -webkit-tap-highlight-color as this gets set to rgba(0, 0, 0, 0) in the next part of the code
var tempCSS = $('a').css('-webkit-tap-highlight-color');
$('body').css('cursor', 'pointer') // Make iOS honour the click event on body
.css('-webkit-tap-highlight-color', 'rgba(0, 0, 0, 0)'); // Stops content flashing when body is clicked
// Re-apply cached CSS
$('a').css('-webkit-tap-highlight-color', tempCSS);
}
See more at http://www.texelate.co.uk/blog/post/124-add-a-click-event-to-html-or-body-on-ios-using-jquery/