1 var btn = document.querySelectorAll('.所点击的类名')[0]; 2 var event = document.createEvent('Events'); 3 event.initEvent('touchstart', true, true); 4 btn.dispatchEvent(event);
1 var btn = document.querySelectorAll('.所点击的类名')[0]; 2 var event = document.createEvent('Events'); 3 event.initEvent('touchstart', true, true); 4 btn.dispatchEvent(event);
转载于:https://www.cnblogs.com/nlyangtong/p/10861449.html