How to find out what actions an element has when it is clicked?

2

I would like to know if you can create a script that shows me the actions of a certain element when it is clicked, or else you can debug it in the Chrome console, for example.

Something that would tell me, for example, what function the click calls.

    
asked by anonymous 23.12.2014 / 14:05

1 answer

3

John, you have! I use Visual Event 2 which is a bookmarklet that you run on the page and it gives a visual reference of which elements in the DOM have events attached. The result is this:

Whenyouhoverovertheboxes,apopupappearswiththecodetobeinvoked!

ThechromeconsolealsodisplaystheeventsofaDOMelement,giveinspectelementonthedesiredelementthenclickEventListeners:

For those who use Firebug this feature has been introduced since version 1.12, see the documentation .

If you want to get this information programmatically you can look at the Visual Event source code or This great answer in English in the original SO English

    
23.12.2014 / 14:22