how to close a tab by clicking a button with html code example Example: javascript close current tab window.close();//closes the current browser tab