title: window.opener call function gives me a document.getElementById(...) is null
body: <p>I have the following code on parent window</p>
  
  <p><strong>Parent Window</strong></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
  //Pop-up call 
   function show_popup()
      {
          var f = window.open("./show_my_popup.php", "mytitle", "width=550, height=500, scrollbars=yes");
      }
  
   //Call Back from Child Window function
  
  
    function GetChildWindowInfo(myval)
     {
      document.getElementById('selecteditem').value = myval;
  
     }
   &lt;/script&gt;
  </code></pre>
  
  <p>And this is the child window part of the code passing value to parent window</p>
  
  <p><strong>Child window</strong></p>
  
  <pre><code>//Drop down Menu
  
  &lt;select id='selecteditem' name='select_item'&gt;
  
  &lt;?php
  foreach($each_query_item as $key =&gt; $value) {
  echo "  &lt;option value='$value' ";
  if($_POST['select_item] == $key) echo "selected";
  echo "&gt;$value &lt;/option&gt;\n";
  }
  ?&gt;
  
  &lt;/select&gt;
  
  //Once you select item click here 
  
   &lt;input type="button" name="submitbutton" value=&lt;?php xl('Click Me','e','\'','\'');?&gt; onclick="javascript:return SendValueToParent();" /&gt;
  
  
   &lt;script type="text/javascript"&gt;
  
   function SendValueToParent()
  {
      var myval = document.getElementById('selecteditem').value;
      window.opener.GetChildWindowInfo(myval);
      window.close();
      return false;
  }
  
  &lt;/script&gt;
  </code></pre>
  
  <p>when I do a alert(myval) on the parent window I get the value I passed; 
  However, I get the document.getElementById(...) is null. Do not understand why, please help me.</p>