How should events ever be set to * capture *?

After reading this page http://www.quirksmode.org/js/events_order.html , I cannot help but say that Microsoft really understood when they decided to make the bubble, because the capture is just .. unintuitive

hence this question: how will any event ever be needed to capture? or just in all the projects you did when you ever needed to capture an event?

+5
source share
1 answer

What Kennebeck mentions in the comments is correct. There are events ( focus, blur) that simply do not bubble, but they will still be captured. This allows you to still use event delegation with these events. Delegating events using bubbling / capture is often cleaner and more efficient.

Here is a good article from Quirks, explaining capture events and why it makes sense when using events like focusand blur: http://www.quirksmode.org/blog/archives/2008/04/delegating_the.html


In my projects, I did not encounter a situation where event capture is required. However, in many places where I used event bubbles, I could use event capture.

+1
source

All Articles