How to close browser window using Javascript

window.opener = self;
 window.close();

I recommend using it in a function like the following:

function close_window() {
  if (confirm("Close Window?")) {
    window.opener = self;
	window.close();
  }
}

You may also like...

Leave a Reply