«   Previous tip Next tip   »

Chrome DevTools: Quickly monitor events in JavaScript from the Console Panel

Last updated: 12th July 2020
Quickly monitor events in JavaScript from the Console Panel

You can log all the events dispatched to an object using the Command Line API method monitorEvents(object [, events]). The event objects are then logged to the Console. Useful when you need a reminder of the available properties on the event object.

An example

As an example, try the following piece of code directly in the Console Panel:

monitorEvents(window, 'click')

When you click around in the webpage, you should now see click events automatically logged to the Console.

«   Previous tip Next tip   »

Sign up to receive a developer tip, in the form of a gif, in your inbox each week