Returns whether the environment reports touch input support.
Some devices support both touch and mouse input, such as laptops with a touchscreen.
true when the environment reports touch support via ontouchstart or navigator.maxTouchPoints; false outside the browser.
true
ontouchstart
navigator.maxTouchPoints
false
isTouchCapable(); // true on touch-capable devices, otherwise false Copy
isTouchCapable(); // true on touch-capable devices, otherwise false
Returns whether the environment reports touch input support.
Some devices support both touch and mouse input, such as laptops with a touchscreen.