📅  最后修改于: 2022-03-11 14:53:23.330000             🧑  作者: Mango
var clickMe = document.getElementById('clickMe');
clickMe.addEventListener('click', function() {
console.log('I was clicked');
}, true);
setTimeout(function() {
var event = new MouseEvent('click'),
canceled = !clickMe.dispatchEvent(event);
if (canceled) {
console.log('Click event was canceled');
}
}, 5000);