Can we attach two eventListeners of same type but different functionality? for example two diff "click" event listeners? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can we attach two eventListeners of same type but different functionality? for example two diff "click" event listeners?

5th Sep 2015, 3:00 PM
Hamed P
1 Answer
+ 5
The event listener section says "The addEventListener() method attaches an event handler to an element without overwriting existing event handlers. You can add many event handlers to one element. You can add many event handlers of the same type to one element, i.e., two "click" events."
17th Dec 2015, 3:46 AM
raymcgill