Open window and access its element from the parent window
<p>Even though there are similar questions to mine <a href="https://stackoverflow.com/questions/10468136/js-open-popup-window-and-acces-its-element-in-another-page">js open popup window and acces it&#39;s element in another page</a> , the solution there didn't work for me ..</p>

<p>I am trying to open a window onclick, and then access a certain element and edit its content , but it's not working.. </p>

<p>Here is the parent html</p>

<pre><code> &lt;!doctype html&gt;
&lt;html&gt;

&lt;head&gt;
    &lt;title&gt;Parent&lt;/title&gt;
    &lt;script src="opener.js"&gt;&lt;/script&gt;
    &lt;meta charset="utf-8"/&gt;
 &lt;/head&gt;

&lt;body&gt;
    &lt;button class="w3-btn w3-container"  id = "submit_btn"&gt;Submit&lt;/button&gt;
&lt;/body&gt;

&lt;/html&gt;
</code></pre>

<p>Child html</p>

<pre><code>   &lt;!doctype html&gt;

&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;Pre:D&lt;/title&gt;
    &lt;link rel="stylesheet" href="http://www.w3schools.com/lib/w3.css"&gt; 
    &lt;meta charset="utf-8"/&gt;
&lt;/head&gt;

&lt;body&gt;
    &lt;input class="w3-input" type="text" id="input_word"  placeholder="enter your word here"&gt;
    &lt;div id="dump" style = "width: 800px"&gt; &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>and here is the opener.js script</p>

<pre><code>window.onload = function(){

document.getElementById("submit_btn").onclick= run;

};

function run(){
    var myWindow = window.open('child.html', "width=850,height=600");

    myWindow.onload = function() {
        myWindow.document.getElementById("dump").innerHTML = 'Janela: ';
    }  
}
</code></pre>

<p>Best</p>