How to check browser for touchstart support using JS/jQuery?

You can detect if the event is supported by:

if ('ontouchstart' in document.documentElement) {
  //...
}

Give a look to this article:

  • Detecting event support without browser sniffing

The isEventSupported function published there, is really good at detecting a wide variety of events, and it’s cross-browser.

Leave a Comment