title: How to set the innerHTML of some element in a window opened by a JavaScript window object?
body: <p>I have some simple JavaScript code like this:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
     function openWindow() {
       var mywindow = window.open("file.html");
       mywindow.document.getElementById("foo").innerHTML="Hey you!!";
     }
  &lt;/script&gt;
  </code></pre>
  
  <p>This function is called with an onclick event.  The window opens fine, but the element's innerHTML does not change.  It is a file I own, so I know I am not being blocked by any security policy, and the element with id 'foo' definitely exists.  (It is a DIV).  I have tried other variations of .innerHTML like .src and .value, but nothing seems to work.  Does anyone have any suggestions?</p>