From b32709b598bcc547fe2b00dfe20aafe0cdb4f094 Mon Sep 17 00:00:00 2001 From: kursadc Date: Sun, 15 Sep 2019 13:18:19 -0400 Subject: [PATCH] Chatbot Submission --- index.html | 1 + script.js | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 script.js diff --git a/index.html b/index.html index 4793879..4eaf969 100644 --- a/index.html +++ b/index.html @@ -2,6 +2,7 @@ My First Chatbot + diff --git a/script.js b/script.js new file mode 100644 index 0000000..f2dec6b --- /dev/null +++ b/script.js @@ -0,0 +1,19 @@ +const chatBotObject = {input:"How are you",output:"Great!"} +function reply() { + let question = document.getElementById("input").value + if (chatBotObject.input === question) { + document.getElementById("output").value = chatBotObject.output + } else { + document.getElementById("output").value = "I don't understand that command. Please enter another." + } + +} + +document.getElementById("submit").addEventListener("click", function() {reply()}) + + + + +console.log(chatBotObject) + +