Sometimes, we want to close current tab in a browser window with JavaScript.
In this article, we’ll look at how to close current tab in a browser window with JavaScript.
How to close current tab in a browser window with JavaScript?
To close current tab in a browser window with JavaScript, we call the window.close
method.
For instance, we write
window.close();
to close the current tab.
Conclusion
To close current tab in a browser window with JavaScript, we call the window.close
method.