Web/API/Touch/identifier

From Get docs
< Web/API‎ | Touch

This is an experimental technologyCheck 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

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
identifier Chrome

Full support 22

Edge

Full support ≤18

Firefox 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 No

Opera

Full support Yes

Safari

No support No

WebView Android

Full support Yes

Chrome Android

Full support Yes

Firefox Android

Full support 6

Opera Android

Full support Yes

Safari iOS

Full support Yes

Samsung Internet Android

Full support Yes

Legend

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