2

I have a form button on a webpage. When the button is clicked, it creates a popup box. I'd like to know where the js function is that triggers the popup.

Does anyone know how to detect that in browser tools?

4thSpace
  • 43,672
  • 97
  • 296
  • 475
  • 1
    Check the button click listeners in the chrome dev tools. If the popup is pre-created and hidden, then you may put a breakpoint on attributes modification of the DOM node. – zerkms Aug 28 '15 at 22:45
  • This post could be helpful http://stackoverflow.com/questions/3787555/how-to-find-out-which-javascript-events-fired. – Vibhesh Kaul Aug 28 '15 at 22:48

1 Answers1

2

In Chrome's developer tools, click on the 'Sources' tab. On the right hand panel, expand the 'Event Listeners' section, open the 'Mouse' section, and select 'Click'. This will set a breakpoint on that event, so when you click the button, it will show you the exact location in the code.

enter image description here

kiranvj
  • 32,342
  • 7
  • 71
  • 76
Michael McMullin
  • 1,450
  • 1
  • 14
  • 25
  • There's mousemove and mouseup. Lots and lots of stuff in those. There is a click at the root level. I'm not sure how to set a breakpoint on it though. – 4thSpace Aug 28 '15 at 23:00
  • I don't have anything like that. Not sure how you got there. – 4thSpace Aug 28 '15 at 23:08
  • You've selected the 'click' option -- that's correct. Now you simply click on the button on your webpage. The code should break at the correct point. Google's [DevTools](https://developer.chrome.com/devtools/docs/javascript-debugging#breakpoints-on-javascript-event-listeners) page might help explain it at bit better. – Michael McMullin Aug 28 '15 at 23:09