W3cubDocs

/DOM

Touch.identifier

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

The Touch.identifierreturns 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 compatibilityUpdate compatibility data on GitHub

Desktop
Chrome Edge Firefox Internet Explorer Opera Safari
Basic support 22 Yes 52
52
Touch events support has been fixed and reenabled in Windows desktop platforms.
18 — 24
Web compatibility issues seen in bug 888304.
No No No
Mobile
Android webview Chrome for Android Edge Mobile Firefox for Android Opera for Android iOS Safari Samsung Internet
Basic support Yes Yes Yes 6 Yes Yes ?

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Touch/identifier