4

I tried to search but not found exact solution.

If a div element has onclick event listener set by jquery than how to get value/function triggered on click in chrome dev tool?

I try in dev tool but it is only showing 'content js min.js:1'.

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

Ankit_Shah55
  • 799
  • 2
  • 9
  • 17
  • You can try the answer from http://stackoverflow.com/questions/2518421/jquery-find-events-handlers-registered-with-an-object – Arun P Johny May 14 '13 at 06:41
  • What exactly did you try? – Alexander May 14 '13 at 06:45
  • Possibly related: [Chrome Dev Tools: Tells me what type of event is attached to element but which file?](http://stackoverflow.com/questions/14881737/chrome-dev-tools-tells-me-what-type-of-event-is-attached-to-element-but-which-f). –  Jul 31 '13 at 21:05

2 Answers2

3

Looks like what you want is to see the click event handlers registered for an element.

You can use event data to achieve this in the console, though you have to note that it is private method - not documented may get changed in future without any notification

Ex:

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

Read this question also

Demo: Fiddle

Community
  • 1
  • 1
Arun P Johny
  • 384,651
  • 66
  • 527
  • 531
2

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

JohnK
  • 6,865
  • 8
  • 49
  • 75