Question · JavaScript and TypeScript course · Module 8: Events and the DOM
Dispatching Custom Events
Which method is used to dispatch (emit) a Custom Event on a DOM element?
Answer options
- element.emitEvent(event)
- element.fireEvent(event)
- element.dispatchEvent(event)
- element.triggerEvent(event)
You can check the correct answer by solving this task in the CodeWorlds game.