How can js tell if he clicked on two fingers or a single finger?

there is a function on the mobile phone that needs to be triggered by a double-finger click. Can this function be realized by js

May.13,2022

https://codeshelper.com/a/11... take a look at the implementation of this article.


var dom = document.getElementById('dom');
dom.addEventListener('touchstart', onTouchStart);

function onTouchStart(e) {
    var len = e.touches.length;
    if (len === 2) {
        console.log('');
    } else if (len === 1) {
        console.log('');
    }
}
Menu