-
Notifications
You must be signed in to change notification settings - Fork 70
/
review.js
27 lines (18 loc) · 1.18 KB
/
review.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
27
let testButton = document.querySelector("#test-button");
let result = document.querySelector("#result");
testButton.addEventListener("click", function() {
let randomNumber = Math.floor(Math.random() * 100); // Generates a random number between 0 and 99
console.log("Random Number: " + randomNumber);
// CODE SOLO
// - When the button is clicked, a random number between 0 and 99 is generated.
// - Depending on the value of this number, different actions will occur:
// 1. If the number is less than 30, a message will be displayed on the web page.
// - The message should read: "The number is less than 30."
// 2. If the number is between 30 and 69, a message will be logged to the console.
// - The message should read: "The number is between 30 and 69."
// 3. If the number is 70 or greater, a different message will be displayed on the web page.
// - The message should read: "The number is 70 or greater."
// Extensions:
// - Try modifying the conditions or the actions taken (such as changing the text or adding new conditions).
// - Try adding an input and test conditions for the random number and user input.
});