So as u can see if the username and password match the FUNK username and password previousley created it should aler CORRECT but even if it is, it alerts incorrect.Where is my mistake, help?
let username;
let password;
let inputpassword;
let inputusername;
function FunkPWinput() {
if ((password == "") && (username == "")) {
alert("Empty");
}
else {
username = document.getElementById("FUNKusername").value;
password = document.getElementById("FUNKpassword").value;
alert("Successfully Submitted \nYour Username is: " username "\nYour Password is: " password)
}
}
function FunkPassword() {
inputpassword = (document.getElementById("LOGINpasswordid").value);
inputusername = (document.getElementById("LOGINusernameid").value);
if ((inputpassword == password) && (inputusername == username))
alert("The entered password and username are correct!");
else
alert("The entered password and username are incorrect!");
}
CodePudding user response:
I suggest using console.log() to output the values of inputpassword, password, inputusername and username. It should give you a good clue. Without the HTML code it's a bit hard to help more.
CodePudding user response:
Attach the code, I will try to solve the problem