+ 1
if you let login be verified by a javascript anybody can enter his username and then rightclick and see the if else code and get the correct password so login is not done in js it by server side languages
however you can make the interface and get its value for validation using
<input type=text>
input{ color=red;}
document.getElementById("input box").value;
you can see many codes here in sololearn or tutorials to see these you can see my codes too tap my profile



