capturing handler
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
JS โฉ browser โฉ event โฉ handler โฉ register โฉ capturing handler
set the third argument to addEventListener() to true:
// capturing event handler ----------------> โญโโโฎ
container.addEventListener("click", handler, true);
If you want to remove a capturing event handler, you must also pass true as the third argument to removeEventListener().
// remove capturing handler ------------------> โญโโโฎ
container.removeEventListener("click", handler, true);