title: How To Call A Javascript Function From Inside Jquery When An ID is Clicked
body: <p>Let's say I have a javascript function called <code>capturedata();</code> 
  I need to call this function when this button is clicked </p>
  
  <pre><code>&lt;button id='yes'&gt;&lt;/button&gt; 
  </code></pre>
  
  <p>For some reasons, I do not want to use any event handler on the html like <code>onclick='capturedata()'</code> 
  Now I have use Jquery this way </p>
  
  <pre><code>$(document).ready(function(){
    $("#yes").click();
    capturedata();
  });
  </code></pre>
  
  <p>But this is not working. I need a better way to handle this, and I do not want to use any event handler like onclick on the html. I want the action to happen automatically once the button is clicked.</p>