Question
can anyone help me with this ? Lab 4 | COMP1073 Client-Side JavaScript Countdown // STEP 1: Open this page in a browser tab and
can anyone help me with this ?
Countdown
// STEP 1: Open this page in a browser tab and open up the console
// STEP 2: Build an HTML element above to contain the value of the var i (the counter inside the loop)
// STEP 3: Change the below loop to a DO/WHILE structure
// STEP 4: Add a condition with an IF statement that checks if countDown is zero - and if it is, output text to the HTML element above that reads, "Blastoff!"
// STEP 5: Change the background color of the page from yellow (from 8-5) , to orange (from 4-1), to red (at 0) using a SWITCH statement
// STEP 3
for (let i = 10; i >= 0; i--) {
setTimeout(function() {
console.log(i);
// STEP 4
// STEP 5
}, 10000 - (1000 * i));
};
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started