How do I view events fired on an element in Chrome DevTools?
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.
Introduction
Chrome DevTools can show you three different layers of event behavior: which listeners are attached, which events are firing in real time, and where execution should pause when an event occurs. Knowing which tool answers which question is the fastest way to debug broken clicks, input handlers, delegated listeners, and propagation bugs.
Start with the Event Listeners Pane
If you want to know what handlers are attached to an element, inspect the node in the Elements panel and open the Event Listeners section in the right sidebar.
That panel helps answer:
- which event types are attached
- whether the handler is attached directly or inherited through bubbling
- where the handler was defined in source code
A useful workflow is:
- select the element in the DOM tree
- open
Event Listeners - expand the relevant event type such as
clickorinput - jump to the handler source from the link DevTools provides
This is the fastest way to answer "what code is wired to this element."
Use monitorEvents for Real-Time Observation
If you want to watch events as they happen rather than only see attached listeners, use the console helper monitorEvents.
Now Chrome logs matching events as they fire. To stop logging:
If you already selected the element in the Elements panel, you can use $0 to refer to it.
This is often the quickest way to verify whether an event is actually firing at all.
Use Event Listener Breakpoints to Pause JavaScript
Sometimes logging is too passive. If the real question is why the event handler behaves incorrectly, pause execution when the event is handled.
In the Sources panel, open Event Listener Breakpoints and check the relevant category such as:
- Mouse
- Keyboard
- Control
- Animation
If you enable click, DevTools pauses when a click handler runs. At that point you can inspect:
- the call stack
- local variables
- the
eventobject - which listener is actually executing
This is the best tool when propagation and framework wrappers make the flow hard to follow from logs alone.
Attached Listeners and Fired Events Are Not the Same
A frequent debugging mistake is assuming that because an event listener is attached, the event must be firing and reaching the handler.
That is not always true. A listener can exist while the event still fails to matter because:
- another element overlays the target
- the element is disabled or not interactable
- a parent or earlier handler stops propagation
- the event is attached higher up through delegation and you are inspecting the wrong node
That is why DevTools gives you separate tools for wiring and runtime behavior. You often need both.
Inspect the Event Object Directly
For more detailed debugging, add a temporary listener from the console and print the event fields you care about.
This is especially useful when debugging delegation or default browser behavior. Just remember that temporary listeners change page behavior slightly, so remove or reload after the investigation.
Frameworks Do Not Remove the Browser Layer
Even if the page uses React, Vue, Angular, or another framework, DOM events still exist at the browser boundary. Frameworks may wrap or delegate them, but DevTools remains useful because it lets you see what the browser itself is doing.
That makes these tools valuable even when you spend most of your time inside a component model.
Common Pitfalls
Looking only at the listener list and assuming that proves the event is firing is the most common mistake.
Using monitorEvents on broad event categories can also flood the console and hide the signal you actually need.
Another common issue is inspecting the visible child node while the listener is attached to a parent via delegation.
Finally, if you need to understand execution flow, use breakpoints instead of trying to infer everything from logs after the fact.
Summary
- use the
Event Listenerspane to inspect what handlers are attached - use
monitorEventswhen you want to see events firing in real time - use event listener breakpoints when you need to pause on the event and inspect execution
- attached listeners and fired events are different debugging questions
- Chrome DevTools remains useful even when the UI code is wrapped by a front-end framework
Related reading
- how do I work around log4net keeping changing publickeytoken
- How do I work out why an ECS health-check is failing?
- How do you address messages coming out of order in a message queue?
- How do you catch this exception?
- How do you convert an iPhone OSStatus code to something useful?
- How do you debug MVC 4 API routes?
- How do you debug MySQL stored procedures?
- How do you debug React Native?
.png&w=3840&q=75)
Tackling System Design Interview Problems
A short course that equips you with the skills to approach system design interviews methodically.
Start the free courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.