Explorar o código

'homework2 js/script.js' sil

mmertalagoz %!s(int64=4) %!d(string=hai) anos
pai
achega
3579c32451
Modificáronse 1 ficheiros con 0 adicións e 52 borrados
  1. 0 52
      homework2 js/script.js

+ 0 - 52
homework2 js/script.js

@@ -1,52 +0,0 @@
-window.onload = () =>{
-    this.sessionStorage.setItem("username", "admin");
-    this.sessionStorage.setItem("password", "qwerty");
-}
-var input = document.getElementsByTagName('input');
-var login = document.getElementById('log-in');
-var form = document.querySelector('form');
-form.onsubmit = ()=>{return false}
-
-login.onclick = ()=>{
-    if ((input[0].value != "") && (input[1].value != "")) 
-    {
-        if ((input[0].value == sessionStorage.getItem("username")) && (input[1].value == sessionStorage.getItem("password"))) 
-        {
-            form.onsubmit = ()=>{return 1}
-        }
-        else
-        {
-            if ((input[0].value != sessionStorage.getItem("username"))) 
-            {
-                input[0].nextElementSibling.textContent = "Имя не правильно";
-                 setTimeout(()=>{
-                     input[0].nextElementSibling.textContent = "";
-                 }, 2000);
-            }
-            if ((input[1].value != sessionStorage.getItem("password"))) 
-            {
-                input[1].nextElementSibling.textContent = "Пароль не правильно";
-                 setTimeout(()=>{
-                     input[1].nextElementSibling.textContent = "";
-                 }, 2000);
-            }
-        }
-    }
-    else
-    {
-        if (input[0].value == "")
-        {
-            input[0].nextElementSibling.textContent = "Username is empty";
-            setTimeout(()=>{
-                input[0].nextElementSibling.textContent = "";
-            }, 2000);
-        }
-        if (input[1].value == "")
-        {
-            input[1].nextElementSibling.textContent = "Password is empty";
-            setTimeout(()=>{
-                input[1].nextElementSibling.textContent = "";
-            }, 2000);
-        }
-    }
-}