title: Is it possible to close parent window from child (Javascript)?
body: <p>I am trying to close parent window from child window using javascript, but its not going to work.</p>
  
  <p>Please share me code if you have any.</p>
  
  <p>My parent html :</p>
  
  <pre><code>&lt;script&gt;
      var winr;
      var selfw;
      function openAn(){
          selfw=self.window;
          winr=window.open("shell.htm","");
  
      }
  
      function justClose(){
          //setTimeout("closeAfterMin()",2000);
  
          winr.close();
      }
  
      function closeAfterMin(){
          alert("sd");
          selfw.close();
      }
  
  &lt;/script&gt;
  &lt;body onload='openAn()' &gt;
      &lt;h1&gt;New Web Project Page&lt;/h1&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>My Child html :</p>
  
  <pre><code> &lt;script&gt;
          function closeAll(){
                 window.parent.close();
  
  
          }
  
      &lt;/script&gt;
      &lt;body&gt;
          &lt;div onclick="closeAll();" onunload="window.opener.close();"&gt;
              Close Parent and self
          &lt;/div&gt;
      &lt;/body&gt;
  </code></pre>
  
  <p>Please help me..</p>