title: jquery performance - .on versus onclick()
body: <p>Two basic questions I'm having trouble finding answers to are as follows:</p>
  
  <p>1) The performance of binding a click function vs. triggering it via onclick="doingness()",
  as in:</p>
  
  <pre><code>$("#id").find('a').on('click',function(){
      $(this).doingness();
  });
  </code></pre>
  
  <p>versus:</p>
  
  <pre><code>&lt;div id="id"&gt;&lt;a onlick="doingness()"&gt;&lt;/a&gt;&lt;/div&gt;
  
  function doingness(){
      $('#id').do();
  }
  </code></pre>
  
  <p>It seems to me that the second one might perform best since the binding does not 
  need to take place until the user actually clicks, so the script doesn't have to
  search thorugh the entire DOM to find an id and bind something to it.. is that right?</p>
  
  <p>Next, I've heard that using these (whatever this is called) are very costly:</p>
  
  <pre><code>$('body').on('click', '#id', function(){
      $(this).do();
  });
  </code></pre>
  
  <p>Of course, I'm using a couple of these with dynamically loaded content so that the
  functions are kept alive. I'm guessing the performance hit mostly has to do with
  the whole function needing to be kept in memory and probably is getting reaccessed
  over and over to check if it should fire off again or not. Instead of this kind of 
  code, I recently realized that I can also just add an onclick="doingness()" in the 
  html instead, and my question is would this help performance?</p>