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();
  }
}

Leave a Reply

Close Menu
%d bloggers like this: