How to close the tab with Javascript? [duplicate]

0

Well, my question is, is there any javascript code that automatically closes the tab that is open on that page?

In other words, I enter a tab in my browser on the page hi.html, is there any code that automatically closes the tab?

Thank you.

    
asked by anonymous 23.07.2016 / 20:36

1 answer

0

Gonçalo, you can use the javascript function:

window.close();

With this you can close the current tab.

    
23.07.2016 / 20:43