title: How can I close the current browser tab when the user click on a button using JavaScript?
body: <p>In a page I have a 'Close' button that when clicked has to close the current browser tab (the tab in which is the page that contain this close button). So I wrote something like this:</p>
  
  <pre><code>&lt;button type="button" class="btn btn-default" style="color: #0F8BB0;" onclick="window.close();"&gt;
      Close
  &lt;/button&gt;
  </code></pre>
  
  <p>But it doesn't work and the current browser tab is not closed. Why? What am I missing? How can I try to solve this issue?</p>