-2

I am trying to make a something in JavaScript that when a user inputs the so called "password", they get automatically redirected to a page. It goes something like this;

<DOCTYPE HTML!>
<html>

<link rel="stylesheet" type="text/css" href="style.css" />

<head>
<h1>Hello World!</h1>
</head>

<p>This is my website!</p>

        Password:
        <input id="password" type="text" name="password" pattern="1234567890">
        <i>Press here:</i>
        <button onclick="Checked()">Click to check
        </button>

<script>  
    function Checked(){
     var text = document.getElementById("password");
if(text) {
    var password = text.value;
} else {
    alert("No input.");
}

    }
</script>


If you input the password, it works, but I have no way to show it works (e.g. redirecting to the page I want it to), so it's kinda useless. I'm kinda a rookie at JavaScript and it took some searching to find it, and I couldn't find something similar. Please help.

0 Answers0