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