eveo
eveo

Reputation: 2833

Debugging event when button is clicked

I'm fairly new to debugging and JavaScript in general. I want to find out when is being called when I click a button.

I click this button and a popup appears, I want to find out what is executed when I click that button and which code is triggering the popup.

How do I do this?

Upvotes: 0

Views: 641

Answers (1)

queuebit
queuebit

Reputation: 180

I am not sure what development tools you are using, but using something like Chrome Dev Tools You can record events and then show what is triggers after click events.

  • Open the inspector
  • Go to Timeline tab
  • Click Record
  • Click the button you want to debug
  • Stop the timeline
  • Investigate the Javascript (purple) events in the timeline

For deeper learning about Chrome Dev Tools, I enjoyed Code School's free class.

Upvotes: 1

Related Questions