title: How to run a callback function on a jQuery trigger("click")?
body: <p>I need to trigger a custom event in the callback of a <code>trigger</code> call, but I can't get it to work.</p>
  
  <p>I tried this:</p>
  
  <pre><code>var $input = $( ".ui-popup-container" ).find( "input" ).eq(2);
  
  function runtests () {
      console.log("clicked the input");
  };
  $input.trigger('click', runtests()); 
  </code></pre>
  
  <p>and this:</p>
  
  <pre><code>var $input = $( ".ui-popup-container" ).find( "input" ).eq(2);
  $input.trigger('click', function(){
      console.log("clicked the input");
  }
  </code></pre>
  
  <p>Neither of which works.</p>
  
  <p><strong>Question:</strong><br>
  How do I get a callback function to run when I'm triggering a click on an element?</p>