I need to make a login form where you can "login" with any username as long as the password is reversed form of the username

I have tried the split(""), reverse(), and join("") method but it does not seem to be working.

```
//HTML
    <form>
      <label>Username: </label>
      <input id="username" type="text" placeholder="Username" />
      <label>Password: </label>
      <input id="password" type="text" placeholder="Password" />
      <button onclick="login()">Login</button>
    </form>

```

```
//Javascript
var username = document.getElementById("username").value;
var password = document.getElementById("password").value;

function stringReverse(string) {
  return string
    .split("")
    .reverse()
    .join("");
}

reverseInput = stringReverse(username);

function login() {
  if (password === reverseInput) {
    alert("Authorized");
  } else {
    alert("Unauthorized");
  }
}

```

I expect the output to popup with the alert "Authorized" when the typed in password is the reversed form of the username input.