代码示例:(标识:event_touch_targettouches_1)
<!DOCTYPE html>
<html>
<meta name="viewport" content="width=device-width, initial-scale=1">
<body ontouchstart="countTouches(event)" ontouchend="countTouches(event)">

<h1>TouchEvent targetTouches 属性</h1>

<p>请触摸此页面上的任意元素。</p>

<p>触摸当前元素的手指数量为 <span id="demo">0</span>。</p>

<p>targetTouches 属性返回一组触摸对象,每个触摸同一 ELEMENT 的手指对应一个对象。</p>

<p><b>注释:</b>触摸事件仅适用于触摸设备。</p>

<script>
function countTouches(event) {
  var x = event.targetTouches.length;
  document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>
运行结果: