//js
document.querySelector("input").onclick = function() {
let result = confirm("Do you want to log out?");
if (result) {
window.location.href = "http://127.0.0.1/qwert-master/";
alert(":-<"); //alert необходим
}
}
//html
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<form>
<input type='submit' name="" id="button">
</form>
</body>
<script type="text/javascript" src="animation.js"></script>
</html>
http://127.0.0.1/qwert-master/
- location сайта, на который должен попадать пользователь, если он хочет разлогиниться, но эта ссылка в коде
if (result) {
window.location.href = "http://127.0.0.1/qwert-master/";
не работает

При этом на любой рандомный сайт интернета я могу перенаправить пользователя