coderef

Touch eventsLimited availability

Touch events touchstart, touchmove, touchend, and touchcancel fire when users interact with a touch-sensitive surface, such as a screen or drawing tablet. These events are similar to mouse events.

Not yet supported in all major browsers — check the table and provide a fallback.

Browser support

DesktopChrome
1–21Not supported
22+Supportedsince Sep 25, 2012
Current: 155
Edge
12+Supportedsince Jul 29, 2015
Current: 154
Firefox
1–51Not supported
52+Supportedsince Mar 7, 2017
Current: 157
Safari
✕Not supportedup to 27
Current: 27
MobileChrome Android
18–18Not supported
25+Supportedsince Feb 27, 2013
Current: 155
Firefox Android
4–5Not supported
6+Supportedsince Aug 16, 2011
Current: 157
Safari iOS
1–2Not supported
≤3+Supportedsince Jun 17, 2009
Current: 27

How to use

Not supported in Safari. Use feature detection below and provide a fallback (or a polyfill) for those browsers.

Example

Full syntax and examples are on MDN: touchcancel event.

Feature detection

JS · check before using
if ("TouchEvent" in globalThis) {
  // TouchEvent is available
} else {
  // load a polyfill or use a fallback
}

Sub-features

Support for each part of the feature (33). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
Element.touchcancel_event221252✕256≤3
Element.touchend_event221252✕256≤3
Element.touchmove_event221252✕256≤3
Element.touchstart_event221252✕256≤3
Touch22≤18✕✕256≤3
Touch.Touch4879✕✕486≤3
Touch.altitudeAngle✕✕✕✕✕✕10
Touch.azimuthAngle✕✕✕✕✕✕10
Touch.clientX22≤18✕✕25610
Touch.clientY22≤18✕✕25610
Touch.force3879✕✕38610
Touch.identifier22≤18✕✕25610
Touch.pageX22≤18✕✕25610
Touch.pageY22≤18✕✕25610
Touch.radiusX3879✕✕38610
Touch.radiusY3879✕✕38610
Touch.rotationAngle4379✕✕43610
Touch.screenX22≤18✕✕25610
Touch.screenY22≤18✕✕25610
Touch.target22≤18✕✕25610
Show 13 more
Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
Touch.touchType✕✕✕✕✕✕10
TouchEvent227952✕2563.2
TouchEvent.TouchEvent4879✕✕48463.2
TouchEvent.altKey227952✕2563.2
TouchEvent.changedTouches227952✕2563.2
TouchEvent.ctrlKey227952✕2563.2
TouchEvent.metaKey227952✕2563.2
TouchEvent.shiftKey227952✕2563.2
TouchEvent.targetTouches227952✕2563.2
TouchEvent.touches227952✕2563.2
TouchList18≤18✕✕1862
TouchList.item18≤18✕✕1862
TouchList.length18≤18✕✕1862