I want to create a button on my website that would close the current browser tab. Searching on stack overflow I got a solution but it isn't working.
This JavaScript code is:
function close_window(){
if (confirm("Are you sure to close window?")) {
close();
}
}
HTML code is:
<button onclick="close_window();"> Close! </button>
So, How can I do this using jQuery or JavaScript for all browser?