[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 }) )

 

posted @ 2022-01-12 02:55  Zhentiw  阅读(161)  评论(0编辑  收藏  举报