Skip to content Skip to sidebar Skip to footer

Is It Possible To Close A Window/tab?

Is it possible to close a browser window/tab with jQuery/Javascript?

Solution 1:

window.close(); But this will only close the window opened by the javascript, otherwise a confirm box will appear

Solution 2:

Yes you can close a window

window.close();//This will close the window

But you will get a confirm box while closing it. If the window in opened using javascript window.open() then you will not see this confirm dialog.

Solution 3:

It is possible with the condition that the window/tab was opened via javascript. Otherwise, the user will be presented with a modal confirmation dialog stating that a script is attempting to close the window.

Solution 4:

try

window.close()

but it works only on tabs you opened with javascript you can't close other tabs by using javascript or jquery

Post a Comment for "Is It Possible To Close A Window/tab?"