271 B
271 B
title, tags
| title | tags |
|---|---|
| supportsTouchEvents | browser,beginner |
Checks if touch events are supported.
- Check if
'ontouchstart'exists inwindow.
const supportsTouchEvents = () =>
window && 'ontouchstart' in window;
supportsTouchEvents(); // true