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
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
identifier | Chrome Full support 22 | Edge Full support ≤18 | Firefox
Full support
52
| 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.