Access child window elements from parent window using Javascript
<p>I need to access child window elements from parent window. I have written the sample snippets below.</p>

<h2>Parent HTML:</h2>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Parent&lt;/title&gt;
&lt;style&gt;
div{
float:left;
cursor:pointer;
}
&lt;/style&gt;
&lt;script type="text/javascript"&gt;
var SubpopUpWin="";
function Opennew(passedURL){
    SubpopUpWin = window.open("popups.html", '_blank','toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes');  SubpopUpWin.document.getElementById("ifrm").src=passedURL;  
SubpopUpWin.document.getElementById("ifrm_title").innerHTML=passedURL;  

}
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div onclick="Opennew('http://www.google.com')"&gt;Google&lt;/div&gt; 
&lt;div onclick="Opennew('http://www.yahoo.com')"&gt;Yahoo&lt;/div&gt;
&lt;div onclick="Opennew('http://www.bing.com')"&gt;Bing&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<h2>popups.html</h2>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Child&lt;/title&gt;
&lt;style&gt;
div{
float:left;
}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div&gt;
  &lt;div id="ifrm_title"&gt;&lt;/div&gt;
  &lt;div style="margin-top:20px"&gt;
   &lt;iframe id="ifrm"  src="" width="470" height="270" frameborder="0" style="margin-top: 34px" scrolling="no"&gt;&lt;/iframe&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>In the above code is not working. Even I have used the below script also.</p>

<pre><code>&lt;script type="text/javascript"&gt;
var SubpopUpWin="";
function Opennew(passedURL){
    SubpopUpWin = window.open("popups.html", '_blank','toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes');
  SubpopUpWin.onload=function(){
     SubpopUpWin.document.getElementById("ifrm").src=passedURL;     
     SubpopUpWin.document.getElementById("ifrm_title").innerHTML=passedURL;     
  }
}
&lt;/script&gt;
</code></pre>

<p>The above code also not working. 
Please share your sugestions/solutions...</p>

<p>Thanks</p>
