这是 实验性技术
检查 浏览器兼容性表格 要小心谨慎在生产中使用这之前。

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.

句法

touchItem.identifier;
					

返回值

A long that represents the unique ID of the 触摸 对象。

范例

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);
					

规范

规范 状态 注释
Touch Events – Level 2 草案 无变化。
触摸事件 推荐 初始定义。

浏览器兼容性

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. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
标识符 Chrome 22 Edge ≤18 Firefox 52
52
Touch events support has been fixed and reenabled in Windows desktop platforms.
不支持 18 — 24
Web compatibility issues seen in bug 888304 .
IE No Opera Yes Safari No WebView Android Yes Chrome Android Yes Firefox Android 6 Opera Android Yes Safari iOS Yes Samsung Internet Android Yes

图例

完整支持

完整支持

不支持

不支持

见实现注意事项。

元数据

  • 最后修改: