Fix When jQuery Click Event Is Not Working On Touch Devices

You might have come across situations when the jQuery click event listener works fine on desktop but it doesn’t fire on mobiles, tablets and other touch devices. This might happen when the event is not attached to an anchor tag but to some other element, like a div. There is a very simple solution to fix this issue.
This is how your original looks like in most cases.

$(document).ready(function(){
    $("div.clickable").click(function(){
        alert('Click');
    });
});

The correct code is below

$(document).ready(function(){
    $("div.clickable").on('click', function () {
        alert('Click');
    });
});

All you have to do is replace this part .click(function with this .on(‘click’, function

I hope this simple trick helped you make your click events work on mobile and other touch devices.