Andrii Kozhyn 2 yıl önce
ebeveyn
işleme
f94eb64ca5
3 değiştirilmiş dosya ile 45 ekleme ve 0 silme
  1. 3 0
      blue_belt/.vscode/settings.json
  2. 22 0
      blue_belt/index.html
  3. 20 0
      blue_belt/scriptBB1.js

+ 3 - 0
blue_belt/.vscode/settings.json

@@ -0,0 +1,3 @@
+{
+    "liveServer.settings.port": 5502
+}

+ 22 - 0
blue_belt/index.html

@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Form</title>
+</head>
+<body>
+    <form class="box" action="index.html" method="POST"></form>
+    <h1>Hello</h1>
+    <input type="text" placeholder="Enter your login" id="name">
+    <input type="text" placeholder="Введите пароль" id="pass">
+    <input type="submit" name="" value="Login" id="login">
+    <hr>
+    <div>Выводим сюда:
+        <span id='result'></span>
+    </div>
+
+    <script src="scriptBB1.js"></script>
+</body>
+</html>

+ 20 - 0
blue_belt/scriptBB1.js

@@ -0,0 +1,20 @@
+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';
+    }
+}