I'm fairly new to JavaScript/jQuery and web programming. I have to textboxes and a button. I'm trying to make it so that when the textboxes have the right characters in them and you click the button, it takes you to another page. But when I click the button, nothing happens.
Here is a link to it on my server: http://jakadproductions.com/testing/
Sorry, I'm only 15.
My code:
$document.ready(function() {
$("#login_button").click(function() {
var username_value = document.getElementById("username_box").value;
var password_value = document.getElementById("password_box").value;
if (username_value == "JakobMorelan" && password_value == "Admin1234") {
window.location = "http://jakadproductions.com/naj7m6j2aajre1o7opjr/";
};
else {
window.location = "http://jakadproductions.com/";
};
});
});
<title>LOGIN</title>
<script src="https://code.jquery.com/jquery-3.2.1.js" integrity="sha256-DZAnKJ/6XZ9si04Hgrsxu/8s717jcIzLy3oi35EouyE=" crossorigin="anonymous"></script>
<h1>LOGIN</h1>
<input id="username_box" type="textbox" placeholder="Username" />
<input id="password_box" type="textbox" placeholder="Password" />
<button id="login_button">Submit</button>
;'s off of the closing brackets in yourifcondition. Your browser should have a developer console where you will see syntax errors like that.