title: javascript close current window
body: <p>please help java script about close current window.
  this is my code and it does not work.</p>
  <pre><code>&lt;input type=&quot;button&quot; class=&quot;btn btn-success&quot;
                       style=&quot;font-weight: bold; display: inline;&quot;
                       value=&quot;Close&quot;
                       onclick=&quot;closeMe()&quot;&gt;
  function closeMe()
  {
      window.opener = self;
      window.close();
  }
  </code></pre>
  <p>I tried this but it doesn't work either:</p>
  <pre><code>var win = window.open(&quot;&quot;, &quot;_self&quot;);
  win.close();
  </code></pre>