Frontend & browser·JavaScript in the browser
you passed `{ capture: true }` and your handler ran before the one on the element that was actually clicked.
Event capturing
Also calledcapture phase, trickling
The first phase of event dispatch, in which the event travels down from the document to the target before any bubble listener runs. It is opt-in and rarely used, but it is the only way to intercept an event before a descendant can stop it — which makes it the tool for global concerns like closing overlays or blocking input during a drag. Handlers registered in this phase run in tree order from the top, the reverse of bubbling.