mercredi 4 juillet 2018

Javascript IF-ELSE Login Page Error, Can't seem to figure it out

Ok, i am a Web Developer or more of a hobby in Web Development and i am making a sign in page with HTML, CSS and JS. So i made two textboxes (Username, Password) with ids matching above and i use variables to set them to their value but what i need to do is to look at the value and if it equals blahblah and password equals blahblahblah then go to blahblahblah and yes i know i could use or should use a server side language but my server does not support server side, Here is my IF ELSE javascript code

var Username = document.getElementById("Username")
var Password = document.getElementById("Password")
if (Username.value = "Username", Password.value = "Password")
{
    window.location.href = "Place.html"
}
else
{
    var WRONG = document.getElementById("WRONG");
    WRONG.style = "color: red;"
}

Also, Happy July 4th!!

Aucun commentaire:

Enregistrer un commentaire