Question
Callback Looping Answer the following set of questions below using the code provided for you in each question. You must use the JavaScript. Part 1:
Callback Looping
Answer the following set of questions below using the code provided for you in each question. You must use the JavaScript.
Part 1: Countdown Experiment 1
Each click of the Countdown Experiment 1 button causes the ID countdown to display a number; beginning with 5 and counting down to 0 after 6 clicks. After reaching 0 it no longer does anything no matter how much you click it. Finally, instead of displaying 0 at the end, display BOOM! and change the background color of the whole page to red. Keep in mind there are 4 ways to display text inside a tag: innerHTML, innerText, textContent and editing TextNode properties directly.
Part 2: Countdown Experiment
Clicking on the Countdown Experiment 2 button causes a countdown animation which counts down 5 to 0 in seconds and finally ends with BOOM! (1 second each number change.) Basically, we are just automating clicking the button every second.
Note: DOM provides two methods (setTimeout & setInterval) which call a given function after a period of time, this is the modern way to delay anything (including animation.) The best approach is to use setTimeout.
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