title: Javascript Passing value from a popup window to its parent window
body: <p>I'm new in javascript and I'm stuck here. 
  Let's say I have a parent window and it has an input field as well as a button that opens a popup window. This popup window contains Images. I just need to copy image URL to that input in the parent window when I click on any image on the popup window.
  Any help please. Thanks</p>
  
  <p>Edit:</p>
  
  <p>This is my javascript code on the popup window</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function clicked(address) {
      window.parent.document.getElementById('copy_img').value = address.src;
  
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code>&lt;input type="text" name="copy_img" id="copy_img" size="133" /&gt;
  &lt;img border="0" onclick="clicked(this)" src="images/1.jpg" width="135" height="46"&gt;
  &lt;img border="0" onclick="clicked(this)" src="images/2.jpg" width="128" height="48"&gt;
  &lt;img border="0" onclick="clicked(this)" src="images/3.jpg" width="305" height="44"&gt;
  </code></pre>
  
  <p><strong>Parent Window HTML Code</strong></p>
  
  <pre><code>&lt;input type="text" name="copy_img" id="copy_img" /&gt;
  </code></pre>
  
  <p>I Just Can't get it to work</p>