DEV Community

Aurélien Delogu
Aurélien Delogu

Posted on

Code snippet: How to test and understand DOM events better with this simple HTML snippet

Because sometimes we don't understand what's going on with DOM events (even more on mobiles), here's an HTML page to test and understand things.

You just have to save it as an HTML file and load it in your browser (by drag-n-droping it for example). At the end of this file there's a list of events that are bypassed to avoid generating a lot of output. You can add/remove events from this list, based on what you want to test. And, of course, you can add/remove HTML tags (just after the <body> tag): add a button, a select, anything you need so you can understand more deeply how DOM events are triggered when interacting with a web page 🦄

Top comments (0)