From a3af90badc0e6e868a0c7daebedd05fd48245d0d Mon Sep 17 00:00:00 2001 From: azizck Date: Mon, 16 Sep 2019 15:45:07 -0400 Subject: [PATCH] done --- js/main.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 js/main.js diff --git a/js/main.js b/js/main.js new file mode 100644 index 0000000..c7fd0d4 --- /dev/null +++ b/js/main.js @@ -0,0 +1,17 @@ +let inOut = { + input: 'Hi', + output: 'Hello ! ' +}; + +function replay() { + let question = document.getElementById("input").value; + let txtArea = document.getElementById("output"); + + if (question === inOut.input) { + txtArea.innerHTML=inOut.output; + } else { + txtArea.innerHTML=" I do not understand that command"; + + } +} +document.getElementById("submit").addEventListener('click',replay); \ No newline at end of file