title: Access elements of parent window from iframe
body: <p>I have a page we can call <code>parent.php</code>. In this page I have an <code>iframe</code> with a submit form and outside of that I have a div with the id "target". Is it possible to submit the form in the iframe and when success refresh the target div. Say load a new page into it or something?</p>
  
  <p>Edit:
  The target div is in the parent page, so my question is basically if you can make for an example a jQuery call outside the iframe to the parent. And how that would look?</p>
  
  <p>Edit 2:
  So this is how my jquery code looks like now. It is in the  of the iframe page. the div #target is in the parent.php</p>
  
  <pre><code>$(;"form[name=my_form]").submit(function(e){     
   e.preventDefault; 
   window.parent.document.getElementById('#target'); 
   $("#target").load("mypage.php", function() { 
   $('form[name=my_form]').submit(); 
   }); 
   })
  </code></pre>
  
  <p>I don't know if the script is active cause the form submits successfully but nothing happens to target.</p>
  
  <p>Edit 3:</p>
  
  <p>Now I'm trying to call the parent page from a link within the iframe. And no success there either:</p>
  
  <pre><code>&lt;a href="javascript:window.parent.getElementById('#target').load('mypage.php');"&gt;Link&lt;/a&gt;
  </code></pre>