on-internet
← Community

How to close current tab in a browser window?

Stack Overflow ·

I want to create a link on a webpage that would close the currently active tab in a browser without closing other tabs in the browser. When the user clicks the close link, an alert message should appear asking the user to confirm with two buttons, "YES" and "NO". If the user clicks "YES", close that page and If "NO", do nothing. How can it be done? Any suggestions?

Comments

Sign in or sign up to comment and upvote.

No comments yet.