Cannot be reversed in the current window?

<a href="" class="loginOut" onclick="logOut()"                 target="_self">
    <span class="btn"></span>
</a>

function logOut () {

window.location.href="login.html";

}
Why can"t I transfer it on the current page?

Apr.02,2021

add the full path


write the href in the a tag javascript:void (0) so that the default jump behavior of the a tag does not occur.
before, the page was directed to the current page (href is empty) because the jump did not start in the logOut () method.
that is

<a href="javascript:void(0)" class="loginOut" onclick="logOut()"                 target="_self">
    <span class="btn"></span>
</a>
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea4ee8-46798.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea4ee8-46798.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?