Does addEventListener overwrites previously defined actions for a particular event?For example,
No, it does not "overwrite" other handlers; that's why it's called "addEventListener". All the handlers are invoked when an event happens.
Now, I will say that mixing the old-style "DOM 0" event handler attachment mechanism (the "onevent" attributes) with event handlers added with "addEventListener()" is not a very good practice.
No.
From MDC:
addEventListener is the way to register an event listener as specified in W3C DOM. Its benefits are as follows:
- It allows adding more than a single handler for an event.
See example.