jQuery: more than one handler for same event

Viewed 123411

What happens if I bind two event handlers to the same event for the same element?

For example:

var elem = $("...")
elem.click(...);
elem.click(...);

Does the last handler "win", or will both handlers be run?

8 Answers

jquery will execute both handler since it allows multiple event handlers. I have created sample code. You can try it

demo

Related