It can be challenging sometimes to debug events, because of how many browsers and devices there are, so I wanted to share one underrated feature called monitorEvents
that can track events on specific elements in the document.
Log all events firing on the body element
monitorEvents(document.body)
Log all mouse events on the body
monitorEvents(document.body, 'mouse')
Log all events on all input elements
monitorEvents(document.body.querySelectorAll('input'))
Top comments (0)