-
Notifications
You must be signed in to change notification settings - Fork 87
/
Copy pathscript.js
26 lines (20 loc) · 1007 Bytes
/
script.js
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
let div = document.querySelector("div");
let submit = document.querySelector("button");
let greetings = ["Hello", "Hola", "Bonjour", "Hallo", "Konnichiwa"];
submit.addEventListener("click", function() {
let userInput = document.querySelector("input").value;
// Do Now: Complete tasks 1-5.
if (userInput === "English") {
div.innerHTML = ""; // 1. Replace empty string with correct array element
} else if (userInput === "Spanish") {
div.innerHTML = ""; // 2. Replace empty string with correct array element
} else if (userInput === "French") {
div.innerHTML = ""; // 3. Replace empty string with correct array element
} else if (userInput === "German") {
div.innerHTML = ""; // 4. Replace empty string with correct array element
} else if (userInput === "Japanese") {
div.innerHTML = ""; // 5. Replace empty string with correct array element
} else {
div.innerHTML = "Apologies, I do not support that language.";
}
});