[Debug] Debug and inspect event listeners with Devtools
You can use getEventListeners(button)
directly inside chrome devtool, but not inside application code.
You can use monitorEvents(button, 'keydown')
, now every times keydown happens, event will be logged into the console.
Use unmonitorEvents(button, 'keydown')
to stop.