This is the opposite of detecting touch support in browsers. How can I detect if a browser has mouse support? Chrome for desktop should return true, Safari for iPad should return false.
I'm thinking that mobile browsers will return false positives for the usual detection tricks.
In browsers that use Touch Events:
var clickEvent = ('ontouchstart' in window ? 'touchend' : 'click');
is basically saying “if the device support touch, only listen to touchend and not click” – which, on a multi-input device, immediately shuts out any interaction via mouse, trackpad or keyboard.
This article discusses your question in details here
Another insightful article here
But, it all depends on what you want to achieve.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With