how to open a link and close previus tab javascript html 5 code example Example: javascript close current tab window.close();//closes the current browser tab