scriptBB1.js 613 B

1234567891011121314151617181920
  1. let credentials = {
  2. login: 'admin',
  3. password: 'qwerty',
  4. };
  5. let username = document.getElementById('name');
  6. let password = document.getElementById('pass');
  7. let loginButton = document.getElementById('login');
  8. let out = document.getElementById('result');
  9. loginButton.onclick = function () {
  10. if (credentials.login == username.value && credentials.password == password.value) {
  11. out.style.color = 'green';
  12. out.innerHTML += 'Рады Вас Видеть';
  13. } else {
  14. out.innerHTML += 'данные введены не верно';
  15. out.style.color = 'red';
  16. }
  17. }