title: How to pass data from Parent html window to pop-up window
body: <p>I am trying to pass some data from parent window to pop up window in html. </p>
  
  <p>Below is my code-</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script type="text/javascript"&gt;
  function init()
  {
      popupWin = window.open('','popupWin','');
      popupWin.document.writeln('&lt;html&gt;&lt;head&gt;&lt;title&gt;test&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&lt;form&gt;&lt;input type="text" id="popupTextBox"/&gt;&lt;/form&gt;&lt;/body&gt;&lt;/html&gt;');
      popupWin.document.close();
      popupText = popupWin.document.getElementById("popupTextBox");
      parentText = document.getElementById("parentTextBox");
  }
  function transferText()
  {
      popupText.value = parentText.value
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;input type="text" id="parentTextBox"/&gt;
  &lt;input type="button" onclick="init();"/&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>But somehow I am not able to pass that textbox data to popup window with the above code. Is there any problem with this?</p>
  
  <p>In general, I am trying to pass some data from parent window to popup window.</p>