how to detect browser tab close event in jquery code example Example: close browser tab using jquery window.top.close(); this will close the current tab for you.