[HTML5 DOM] dispatchEvent

Most of the time,we use DOMElement.click():

button.click()

Actually it is a shortcut for:

button.dispatchEvent(
    new MouseEvent('click', {
        bubble: true,
        cancelable: true,
        composed: true, 
button: 0 }) )
原文地址:https://www.cnblogs.com/Answer1215/p/15790902.html