Aug 30, 2012

How to detect what JavaScript function is hooked up to an element

 

Recently I worked a lot with front-end development, and most of the time I want to know what JavaScript function is fired when I clicked on some buttons or images.

Luckily with Chrome, it is so easy.

How?

In Chrome, press F12 – it will open developer tool. Now right click on the element and select Inspect element. In the developer tool, look for the right hand side and expand Event Listeners. Tada, there you go – all the events that hook up to that element are shown. See the image below:

image

No comments:

Post a Comment