title: How to detect IE11 close event
body: <p>I am now trying to detect only the event of the browser close button of IE11 in JavaScript.</p>
  
  <p>I was able to detect the browser close button with the onbeforeunload event, but I also have trouble picking up other page transition events.</p>
  
  <p>This code is I trying on it.</p>
  
  <pre><code>window.onbeforeunload = function(event) {
      alert('Sure you want to close ?');
  }
  </code></pre>
  
  <p>Is there any good way to do it ?</p>