Touch.identifier

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The Touch.identifier returns a value uniquely identifying this point of contact with the touch surface. This value remains consistent for every event involving this finger's (or stylus's) movement on the surface until it is lifted off the surface.

Syntax

touchItem.identifier;

Return value

A long that represents the unique ID of the Touch object.

Example

someElement.addEventListener('touchmove', function(e) {
// Iterate through the list of touch points that changed
// since the last event and print each touch point's identifier.
  for (var i=0; i < e.changedTouches.length; i++) {
    console.log("changedTouches[" + i + "].identifier = " + e.changedTouches[i].identifier);
  }
}, false);

Specifications

Specification Status Comment
Touch Events – Level 2 Draft No change.
Touch Events Recommendation Initial definition.

Browser compatibility

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
identifierChrome Full support 22Edge Full support ≤18Firefox Full support 52
Notes
Full support 52
Notes
Notes Touch events support has been fixed and reenabled in Windows desktop platforms.
No support 18 — 24
Notes
Notes Web compatibility issues seen in bug 888304.
IE No support NoOpera Full support YesSafari No support NoWebView Android Full support YesChrome Android Full support YesFirefox Android Full support 6Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes

Legend

Full support
Full support
No support
No support
See implementation notes.
See implementation notes.