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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!