dheil
dheil

Reputation: 105

Will adding an event of same kind append or override the previously added event with the same name?

I append an event at start:

myObject.on("myEvent",myFuncONE);

later on the same object should get the same event but with another function

myObject.on("myEvent",myFuncTWO);

will that override the first one or will both functions be executed?

Upvotes: 0

Views: 39

Answers (1)

Barmar
Barmar

Reputation: 781210

They will both be executed. You can have as many event handlers as you want, and they'll all be run.

Upvotes: 1

Related Questions