how to detect only browser close button event in javascript or jquery, No page refresh etc
<p>Kindly help me, how can i detect only browser / tab close button event  in javascript  or jquery. I mean only close button no page refresh and any other menu link opening etc.</p>

<p>I tried this code  on onbeforeunload event of javascript</p>

<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>function handleBrowserCloseButton(event) {

   if(window.event.clientX &lt; 0 &amp;&amp; window.event.clientY &lt;0)
    {
      alert('Browser close button clicked');    
    }
} </code></pre>
</div>
</div>
</p>

<p>But unfortunately it did not solved my problem. Kindly help me.</p>