Javascript - programmatically invoking events

前端 未结 2 850
[愿得一人]
[愿得一人] 2020-12-11 22:45

Say I add events to an object using either addEventListener or attachEvent (depending on the browser); is it possible to later invoke those events programmatically?

2条回答
  •  自闭症患者
    2020-12-11 23:33

    Can you not create functions that do the work required, run those from the events then run those same functions later when required?

提交回复
热议问题