title: emulate a click on a span jquery
body: <p>Hi is there any way to emulate a click on a span when an user click's an image in another location of the page? Can you use for example</p>
  
  <pre><code>&lt;div id="g1"&gt;
  &lt;span&gt;hey&lt;/span&gt;
  &lt;span&gt;second hey&lt;/span&gt;
  &lt;/div&gt;
  
  &lt;div id="a2"&gt;
  &lt;img id="img" src="....."/&gt;
  &lt;/div&gt;
  
  &lt;script type="text/javascript"&gt;
  $(document).on('click', '#img', function(){
  $('#g1 &gt; span:first-child').trigger('click');
  </code></pre>
  
  <p>Will this work or is there any other form to emulate the click on the first span when the user clicks the image?</p>
  
  <p>What if the span you need is in an iframe and the image clicked is outside the iframe?</p>