title: How to get JQuery.trigger('click'); to initiate a mouse click
body: <p>I'm having a hard time understand how to simulate a mouse click using JQuery. Can someone please inform me as to what i'm doing wrong.</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;a id="bar" href="http://stackoverflow.com" target="_blank"&gt;Don't click me!&lt;/a&gt;
  &lt;span id="foo"&gt;Click me!&lt;/span&gt;
  </code></pre>
  
  <p>jQuery:</p>
  
  <pre><code>jQuery('#foo').on('click', function(){
      jQuery('#bar').trigger('click');
  });
  </code></pre>
  
  <p>Demo: <a href="http://jsfiddle.net/8AVau/" rel="noreferrer"><strong>FIDDLE</strong></a> </p>
  
  <p>when I click on button #foo I want to simulate a click on #bar however when I attempt this, nothing happens. I also tried <code>jQuery(document).ready(function(){...})</code> but without success.</p>