log.js 571 B

12345678910111213141516171819
  1. var names = ["1","Dr_Evel","Yang_Evel","admin"];
  2. var keys = ["1","123123","456456", "qwerty"];
  3. debugger;
  4. function Check() {
  5. var entrance = document.getElementsByTagName("img");
  6. var login = document.getElementById("log").value;
  7. var password = document.getElementById("password").value;
  8. for (var i = 0; i <= names.length; i++)
  9. if (names [i] == login && keys [i] == password) {
  10. entrance[0].setAttribute("src", 'logOn.jpg');
  11. return true;
  12. } else {
  13. entrance[0].setAttribute("src", "lose.jpg");
  14. }
  15. }