title: jQuery to trigger a click on an iFrame?
body: <p>If a user clicks on an image I want that to simultaneously trigger a click on a specified iFrame as well. Is that possible? The image and iFrame are located on the same page. If so, can you please show me the code that would work? </p>
  
  <p>Here's what I have so far:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;script src="http://code.jquery.com/jquery-1.9.1.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;img id="image" src="https://www.google.com/images/srpr/logo4w.png"&gt;
  
  &lt;iframe id="iframe" src="http://www.test.com" height= "100" width="160"&gt;&lt;/iframe&gt;
  
  &lt;script&gt;
  jQuery("input.image").click(function(){
     $("#iframe").click()
  });
  &lt;/script&gt; 
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>