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)

Become a Moderator Can you help us make DEV a better place?

Fill out this survey and help us by becoming a tag moderator here at DEV.