I'm working in a sign in page for a school project. For the moment, it only needs to recognize a simple password and user, and then redirect the website to a main page.

I've been trying the following code in jquery:

```
function validate(input) {
    if ($(input).attr('type') == 'email' || $(input).attr('name') == 'email') {
        if ($(input).val().trim().match(/^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{1,5}|[0-9]{1,3})(\]?)$/) == null) {
            return false;
        }
    } else {
        if ($(input).val().trim() == '') {
            return false;
        }
        if ($(username).val().trim() == 'user' && $(password).val().trim() == '123456789') {
            open ("https://stackoverflow.com");

        }
    }

}

```

If I use open ("https://stackoverflow.com"); it does open in a new tab the url, but, what I need is to open an html file within the same folder where the .js file is stored, however, "open" is not working for that purpose.

How can I redirect to an html file in the same local folder after validating the password?

Note: I'll also have to add that I've been trying to use:

```
window.location.replace('http://www.example.com'
window.location.assign('http://www.example.com'
window.location.href = 'http://www.example.com'

```

And none of them seem work, only 'open' does something with the URLs, but doesn't work for local files such as ../admin.html