I´m following your advice, and I´m trying to learn all that I can regardings to Events.
I quote: “After an event object is created, we should “run” it on an element using the call elem.dispatchEvent( event ). Then the handler reacts on it as if it were a regular built-in event.
They put the following example:
<button id="elem" onclick="alert('Click!');">Autoclick</button>
let event = new Event("click");
Let me add that I understand the Event Constructor(that they mention in the web page).
What I don´t understand is the purpose of dispatchEvent, what is the difference (or how it relates) with addEventListener ??