From fda6bdf1ebf59f1f86f122186ba726c1e83881f7 Mon Sep 17 00:00:00 2001 From: Saksham Mittal Date: Sat, 2 Apr 2022 18:58:42 +0530 Subject: Initial commit Basic webpage is setup with the ability to print the 5 letter word that a user types into the text box --- script.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 script.js (limited to 'script.js') diff --git a/script.js b/script.js new file mode 100644 index 0000000..5f3ad23 --- /dev/null +++ b/script.js @@ -0,0 +1,14 @@ +let answer = "hello"; +let form = document.querySelector('form'); + +let input = document.querySelector('input'); + +function hello(event) { + event.preventDefault(); + let name = document.querySelector('#result'); + if (input.value.length == 5) { + name.innerHTML = `${input.value}`; + } else { + name.innerHTML = ""; + } +} -- cgit 1.4.1