How to get event listener from item set via jQuery in chrome dev tool?

I tried to search, but could not find the exact solution.

If the div element has an onclick event listener installed by jquery, how can I get the value / function called by clicking on the chrome dev tool?

I am trying to use the dev tool, but it only shows "content js min.js: 1".

Please see this image http://myfilestore.tk/net/Capture.PNG?a=so14052013

+4
source share
2 answers

It looks like you want to see the click event handlers registered for the item.

You can use the event data to achieve this in the console, although you should notice that this is a private method - the non-documented one may change in the future without notice

Example:

var clicks = jQuery._data( jQuery('element')[0] , "events" ).click; 

Read this question also

Demo: Fiddle

+3
source

jQuery Audit plugin The plugin should do the trick. It is not perfect, but it should give you what you want.

+2
source

Source: https://habr.com/ru/post/1480639/


All Articles