I am having trouble with my javascript.
function login() {
var username = document.getElementById("username").value;
var password = document.getElementById("password").value;
var combine = (username + password)
if (combine = "userpassword")
alert("Logged in.")
} else {
alert("Incorrect username or Password.")
}
}
<!DOCTYPE HTML>
<html>
<body>
<form id="login" onsubmit="return false;">
Username:<br>
<input type="text" name="username" id="username"><br>
Password:<br>
<input type="text" name="password" id="password"><br>
<input type="submit" type="POST" onclick="login();" />
</form>
Aucun commentaire:
Enregistrer un commentaire