main.js 527 B

12345678910111213141516171819
  1. var credentials = {
  2. login: 'admin',
  3. password: 'qwerty',};
  4. var userLogin;
  5. var userPassword;
  6. function func(){
  7. userLogin = document.getElementById("login").value;
  8. userPassword = document.getElementById("password").value;
  9. if (userLogin === credentials.login && userPassword === credentials.password){
  10. document.getElementById("success").style.display="block";
  11. return false;
  12. }
  13. else {
  14. document.getElementById("wrong").style.display="block";
  15. return false;
  16. }
  17. }
  18. document.getElementById("submit").onclick = func;