Closing the Browser tab using js or jquery
You can't close the current browser tab with javascript. It would be annoying for the user if sites start to close themselves like this without the user intent so browsers simply do not allow this. Don't forget that the notion of a browser tab is not defined anywhere in the HTML nor the EcmaScript specifications, some browsers don't even have tabs.
You could of course write a plugin that you will install on your client's browser that will do the job.
Rakhitha Nimesh
Web Developer and part time blogger from Sri Lanka seeking the knowledge in innovative web technologies and projects. I write on my own site and always available to do innovative projects. You can check my plugins at WPExpertDeveloper
Updated on June 27, 2022Comments
-
Rakhitha Nimesh almost 2 years
I want to close the current browser tab by clicking a button. window.close method does not work.
-
fuxia almost 11 yearsPlease add an explanation to your answer: why could that solve the problem?