title: Control one iFrame from another iFrame
body: <p>This works …</p>
  
  <pre><code>&lt;a href="page.html" target="frameName"&gt;Link text&lt;/a&gt;
  </code></pre>
  
  <p>but this doesn't …</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      window.onload = function() {
        var a = document.getElementById("mylink");
        a.onclick = function() {
          parent.document.getElementById('frameName').src = 'page.html';
        }
      }
  &lt;/script&gt;
  
  &lt;a id="mylink" href="page.html"&gt;LINK&lt;/a&gt;
  </code></pre>
  
  <p>Any idea why I can't get the element by id from one iFrame to another? Also I know very little code so I apologize in advance if its obvious.</p>