From e2e0c18f42ba403c9005ff96b75df681049f4257 Mon Sep 17 00:00:00 2001 From: jiyoon Date: Mon, 23 May 2022 21:56:22 +0900 Subject: [PATCH] =?UTF-8?q?hello.html,=20hello.js,=20hello.css=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hello.css | 7 +++++++ hello.html | 18 ++++++++++++++++++ hello.js | 13 +++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 hello.css create mode 100644 hello.html create mode 100644 hello.js diff --git a/hello.css b/hello.css new file mode 100644 index 0000000..48e5f2e --- /dev/null +++ b/hello.css @@ -0,0 +1,7 @@ +.hidden { + display : none; +} + +body { + background-color: beige; +} \ No newline at end of file diff --git a/hello.html b/hello.html new file mode 100644 index 0000000..9bf5d88 --- /dev/null +++ b/hello.html @@ -0,0 +1,18 @@ + + + + + + + + hello + + +
+ + +
+

+ + + \ No newline at end of file diff --git a/hello.js b/hello.js new file mode 100644 index 0000000..bc8f2b1 --- /dev/null +++ b/hello.js @@ -0,0 +1,13 @@ +const loginForm = document.querySelector("#login-form"); +const loginInput = document.querySelector("#login-form input"); +const hello = document.querySelector("#hello"); + +function loginSB(event) { + event.preventDefault(); + loginForm.classList.add("hidden"); + const userName = loginInput.value; + hello.innerText = `Nice to meet you, ${userName} !`; + hello.classList.remove("hidden"); +} + +loginForm.addEventListener("submit", loginSB); \ No newline at end of file