I am making this simple login form using html css and js. And I am receiving this error when i click the login button: This page isn’t working…If the problem continues, contact the site owner. HTTP ERROR 405.
Below are the codes:
JAVASCRIPT:
function validate(){
var username = document.getElementById(username).value
var password = document.getElementById(password).value
if(username == "judge1" && password=="1234") {
alert("Login Successful");
return false;
}
else{
alert("Login Failed");
}
}
HTML:
<form class="inputs" action="/" method="POST">
<input type="text" class="username" placeholder="Username" id="username"> <br/>
<input type="password" class="password" placeholder="Password" id="password"> <br/>
<input type="submit" value="Login" onclick="validate()">
</form>
I tried googling it but I’m having a hard time in finding the solution. I am still new in this so please help.