Javascript : add string to iframe with window.opener form popup
<p>I use this code for add string to element of parent windows form popup :</p>

<pre><code>window.opener.document.getElementById('myid').innerHTML += 'string';
</code></pre>

<p>Now I want to add string to element of iframe form popup.Both of iframe and parent is in the same domain. I try this code but not work:</p>

<pre><code>parent.myframename.window.opener.document.getElementById('iframeelementid').innerHTML +=  'string';
</code></pre>

<p>What is wrong? Is there any way to do this?</p>

<p>Thanks for any help.</p>

<p><em><strong></em>* UPDATE <em>*</em></strong> </p>

<p>This is my complete code. Main page:</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;script&gt;
function myPopup() {
  window.open( "pop.htm", "myWindow", "status = 1, height = 180px, width = 330px)
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;textarea id="input"&gt;&lt;iframe src="frame.html" name="myframe"&gt;&lt;/iframe&gt; &lt;/textarea&gt;

&lt;a href="" onclick="myPopup()"&gt;Popup&lt;/a&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>and pop.htm:</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;script&gt;
function insert() {
  parent.myframe.window.opener.document.getElementById('inframe').innerHTML += 'asasasas';
  window.close();
  return false;
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
            &lt;input type="button" id="insert" onclick="insert()" value="insert" /&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>and iframe.html:</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;/head&gt;
&lt;body&gt;
       &lt;span id="inframe"&gt;&lt;/span&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
