A
A
A_Vernoy2018-02-12 23:19:40
JavaScript
A_Vernoy, 2018-02-12 23:19:40

How to close the current browser tab using JS?

Hello! I ask for your help, because I am just a beginner in JS.
You want to close the current tab when you click on the button.
var close_btn = document.getElementById('close_btn');
close_btn.onclick = function(){
window.close();
}
doesn't work. How to be?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex Phil, 2018-02-12
@A_Vernoy

I think this will help you How to close a browser tab using JS?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question