It's for example important when debugging a web page to see how many submit events a form element sends out.
With this debugging method you prevent sending and tracking browser events multiple times.
There is a handy API in Chrome developer tools that makes this easy.
If you want to stop listening for events again, you simply use:
Now with this helpful debugging tool in our toolbox, we can for example select a form element in Chrome developer tools to start monitoring submit events.
After you select the element in the elements tab, Chrome Dev Tools will show a little
$0 sign next to it.
If you keep the HTML-Element selected, you can now use the
$0 to quickly reference the element in the console - without needing a CSS selector. Now together with the
Let me know on Twitter if it worked for you and if you liked this. ✌️