Help needed with javascript redirecting

Hello, I need help with my simple login page, after you login correctly it’s supposed to take you to a website (google for example). But It’s not working.

HTML Code:

<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Admin Login</title>
    <link rel="stylesheet" href="/assets/css/admin.css">
    <script src="/assets/js/admin-login.js"></script>
    <form class="box" action="admin.html" method="GET">
    Administrator Access
<input type="text" name="" placeholder="Username" id="username">
<input type="password" name="" placeholder="Password" id="password">
<input type="submit" name="" value="LOGIN" onclick="validate()">


JavaScript Code:

function validate()
    var username=document.getElementById("username").value;
    var password=document.getElementById("password").value;
    if(username=="user" & password=="pass") {

        window.location = ""
        return false;
        alert("sad fail ;c")

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.