While this is intended to be a crash course, I do want to note that event listeners don't quite get called like that. The event bubbling and capturing is quite accurate, but there are some specific differences in how listeners on any given element's event are called when compared to simply looping through and executing them:
The order in which they are called is not determinate. All of them will be called, but you cannot rely on the order in which they are called. Throwing an exception will also not prevent other event listeners from executing.
Funny, whenever I first understand something mysterious like that, I feel more hopeful and confident. If it's magic, how can I trust it? What do I do if it doesn't behave as expected?
If I understand it, I can face it. I can figure out problems. I can find creative approaches.
The order in which they are called is not determinate. All of them will be called, but you cannot rely on the order in which they are called. Throwing an exception will also not prevent other event listeners from executing.
See: http://ajaxian.com/archives/the-differences-between-callback...