function touchesInTarget(ev) {
// Return true if all of the touches are within the target element;
// otherwise return false.
return ev.touches.length === ev.targetTouches.length;
}TouchEvent: targetTouches property / notebook
TouchEvent: targetTouches property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.