Document and window click event not works in iPhone and iPad as expected

$(document).click(function (e) {}); will work perfectly on IE, Firefox and Chrome. But it won't work in iPhone and iPad Safari except some elements. Since by default "DIVs" are not "clickable" elements, we have to make iOS treat it as clickable. The problem is iPhones dont raise click events. They raise "touch" events.  A small work around is to make the element clickable using CSS. So you need to add

div { // you can add element's class or id
    cursor: pointer; 
}

 

Category: