title: How to find what code is run by a button or element in Chrome using Developer Tools
body: <p>I'm using Chrome and my own website.</p>
  <h3>What I know from the inside:</h3>
  <p><strong>1</strong>) I have a form where people sign up by clicking this orange image-button:</p>
  <p><img src="https://i.stack.imgur.com/U2BoA.png" alt="enter image description here" /></p>
  <p><strong>2</strong>) I inspect it, and this is all it is:
  <code>&lt;img class=&quot;formSend&quot; src=&quot;images/botoninscribirse2.png&quot;&gt;</code></p>
  <p><strong>3</strong>)  At the top of the source code, there are tons of script sources. I know which one the button calls because I coded it: <code>&lt;script src=&quot;js/jquery2.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;</code></p>
  <p><strong>4</strong>)  Within that file, you could find: <code>$(&quot;.formSend&quot;).click(function() { ... });</code> which is what is triggered by the button (to do a fairly complex form validation and submit) and <strong>what I want is to be able to find that</strong> using chrome dev tools on any website.</p>
  <h2>How can I find out where does the element call?</h2>
  <p>Listeners tab didn't work for me. So then I tried looking the click event listeners, which seemed like a safe bet to me but... there's no <code>jquery2.js</code> in there (and I wouldn't really know which file the code is so I'd waste time checking all these...):</p>
  <p><img src="https://i.stack.imgur.com/eUevQ.png" alt="enter image description here" /></p>
  <p>My <code>$(&quot;.formSend&quot;).click(function() { ... });</code> function within <code>jquery2.js</code> file is not there.</p>
  <p><a href="https://stackoverflow.com/users/238722/jesse">Jesse</a> explains <strong>why</strong>:</p>
  <blockquote>
  <p><em>&quot;Finally, the reason why your function is not directly bound to the click event handler is because jQuery returns a function that gets bound. jQuery's function, in turn, goes through some abstraction layers and checks, and somewhere in there, it executes your function.&quot;</em></p>
  </blockquote>
  <hr />
  <p>As suggested by some of you I've collected the methods that worked <a href="https://stackoverflow.com/a/25818251/2495341">in one answer down below</a>.</p>