1234567891011121314151617181920 |
- let credentials = {
- login: 'admin',
- password: 'qwerty',
- };
- let username = document.getElementById('name');
- let password = document.getElementById('pass');
- let loginButton = document.getElementById('login');
- let out = document.getElementById('result');
- loginButton.onclick = function () {
- if (credentials.login == username.value && credentials.password == password.value) {
- out.style.color = 'green';
- out.innerHTML += 'Рады Вас Видеть';
-
- } else {
- out.innerHTML += 'данные введены не верно';
- out.style.color = 'red';
- }
- }
|