Check if the touch events are supported

Check if the current browser supports the touch events:

const touchSupported = 'ontouchstart' in window || 
(window.DocumentTouch && document instanceof DocumentTouch);

More

Previous
Check if the native date input is supported
Next
Copy text to the clipboard