30 seconds of codeBack to Home
Triggers a specific event on a given element, optionally passing custom data.
new CustomEvent() to create an event from the specified
eventType and details.
el.dispatchEvent() to trigger the newly created event on the given element.
Omit the third argument,
detail, if you do not want to pass custom data to the triggered event.