MDN’s new design is in Beta! A sneak peek:

Break on a DOM event

This page describes the JavaScript Debugger as it appears before Firefox 52.

See what it looks like from Firefox 52 onwards.

If you're listening to a particular DOM event, you can tell the debugger to break when the event is triggered without having to track down the listener and set a breakpoint manually.

First, open the events pane by clicking the button in the toolbar that opens the shared variables/events pane. Then click the tab labeled "Events". The events pane will list all events for which you have assigned a listener:

Then check the box next to the event you want to break at.

When the event is triggered the code will break at the start of your listener.

Document Tags and Contributors

 Contributors to this page: wbamberg
 Last updated by: wbamberg,