I want to logout a link in the same window and in the same tab that contains the page with the link.
When I try click logout a link by using window.open, then it opens in new tab—not in the same tab in the same window and the current page will not logout unless i refresh the pages.
+"<button class=\"withdraw\" onclick=\"window.open(\'/index/LogOut.html\')\">Logout</button>"
Instead of using
window.open, you can set the
window.location.href property which will caues the current window to navigate to the specified URL.
<button class="withdraw" onclick="window.location.href='/index/LogOut.html'">Logout</button>