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