How to close the current tab in a browser window with JavaScript?

Spread the love

Sometimes, we want to close the current tab in a browser window with JavaScript.

In this article, we’ll look at how to close the current tab in a browser window with JavaScript.

How to close the current tab in a browser window with JavaScript?

To close the current tab in a browser window with JavaScript, we use the window.close method.

For instance, we write

window.close();

to close the current tab.

Conclusion

To close the current tab in a browser window with JavaScript, we use the window.close method.

Leave a Reply

Your email address will not be published. Required fields are marked *