-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChatBot.js
More file actions
20 lines (17 loc) · 732 Bytes
/
ChatBot.js
File metadata and controls
20 lines (17 loc) · 732 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function talk(){
var know = {
"who are you" : "Hello, Codewith_random here",
"How are you" : "Good :)",
"What can i do for you" : "Please Give us A follow & Like",
"Your followers" : "I have my family off 5000 members, i don't have followers, have supportive Family",
"Ok" : "Thank you So Much",
"Bye" : "Okey! will meet soon..",
};
var user = document.getElementById('userbox').value;
document.getElementById('chatlog').innerHTML = user + "<br>";
if (user in know) {
document.getElementById('chatlog').innerHTML = know[user] + "<br>";
}else{
document.getElementById('chatlog').innerHTML = "Sorry, I didn't understand <br>";
}
}