Put in order · JavaScript and TypeScript course · Module 8: Events and the DOM

Custom Event Lifecycle

Arrange the steps for creating and dispatching a Custom Event:

Items to put in order

  • Creating new CustomEvent() with type and detail
  • Adding an event listener on the target element
  • Handling the event in the callback handler
  • Calling element.dispatchEvent()

You can check the correct answer by solving this task in the CodeWorlds game.