-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
36 lines (23 loc) · 1016 Bytes
/
script.js
File metadata and controls
36 lines (23 loc) · 1016 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
console.log("Hi there!");
console.log("I am excited to talk to you.");
let bot;
bot = "teacherBot";
let botLocation = "the universe";
console.log("Allow me to introduce myself.");
const botIntroduction = "My name is " + bot + ".";
console.log(botIntroduction);
const botLocationSentence = "I live in " + botLocation + ".";
console.log(botLocationSentence);
bot = "professorBot";
const nicknameIntroduction = "My nickname is " + bot + ".";
console.log(nicknameIntroduction);
bot = "awesomeTeacherBot";
const newNicknameGreeting = "I love my nickname but I wish people would call me " + bot + ".";
console.log(newNicknameGreeting);
const favoriteSubject = "Computer Science";
const favoriteSubjectSentence = "My favorite subject is " + favoriteSubject + ".";
console.log(favoriteSubjectSentence);
document.getElementById("btn").addEventListener("click", function () {
const name = document.getElementById("nameInput").value;
document.getElementById("message").textContent = "Hello " + name + "!";
});