diff options
| author | Saksham Mittal <gotlouemail@gmail.com> | 2022-04-02 18:58:42 +0530 |
|---|---|---|
| committer | Saksham Mittal <gotlouemail@gmail.com> | 2022-04-02 18:58:42 +0530 |
| commit | fda6bdf1ebf59f1f86f122186ba726c1e83881f7 (patch) | |
| tree | 0f2e50f15ce9a04224b8a2cf174d0cf205f3b45b /script.js | |
| download | purple-fda6bdf1ebf59f1f86f122186ba726c1e83881f7.tar.gz | |
Initial commit
Basic webpage is setup with the ability to print the 5 letter word that a user types into the text box
Diffstat (limited to 'script.js')
| -rw-r--r-- | script.js | 14 |
1 files changed, 14 insertions, 0 deletions
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 = ""; + } +} |
