Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I find out what javascript function is being called by an object's onclick event?

Tags:

javascript

How do I find out what javascript function is being called by an object's onclick event? Even better, can I then find out which included .js file that function is in?

like image 285
Cyrcle Avatar asked May 17 '12 15:05

Cyrcle


1 Answers

I use Chrome's Developer Tools for this:

Event Listener Breakpoints in Google Chrome's developer tools

Check the click box, and then click on the element on the page you want to find the handler for. If you are using jQuery (or similar library), you may have to step through their code before you get to yours.

like image 72
benekastah Avatar answered Oct 20 '22 17:10

benekastah