I have been working on an assignment and I have been asked to create a login page by using HTML and javascripts by implementing hashmaps, I have implemented it by using variables. cuser and cpass holds the correct username and the password and "t1" and "t2" are the textfields where the user types in the username and password.
var cuser="admin";
var cpass="pass";
var user=document.getElementById("t1").value;
var pass=document.getElementById("t2").value;
and I have used an if condition to validate the username and password
if(user == cuser && pass == cpass)
{
alert("You are logged in as : " +cuser);
}
I have to implement this using hashmaps, can someone please help me with this how can I create a hashtable and validate the user and password using the key and the value.