cramirezorozco5038 cramirezorozco5038
  • 03-07-2020
  • Computers and Technology
contestada

Write a setInterval() function that increases the count by 1 and displays the new count in counterElement every 100 milliseconds. Call clearInterval() to cancel the interval when the count displays 5.

Respuesta :

batolisis
batolisis batolisis
  • 04-07-2020

Answer:

Some parts of your question is missing here is the missing part

var count = 0;

var counterElement = document.getElementById("counter");

counterElement.innerHTML = count;

Answer : var interval = setInterval(function () {

   count++;

   counterElement.innerHTML = count;

   if (count === 5) {

       clearTimeout(interval);

   }

}, 300);

Explanation:

var interval = setInterval(function () {

   count++;

   counterElement.innerHTML = count;

   if (count === 5) {

       clearTimeout(interval);

   }

}, 300);

Answer Link

Otras preguntas

what is the value of x in the following equation? 2(x-3)+3=6x-5 x=2 x=-2 x=1/2 x=4
identify the tense of Alex runs two miles each day
Animists generally believe that: A. Meditation leads followers to nirvana. B. After death the soulis reborn in another human form. C. Holy wars must be fought t
Trevor paid a total of $1.08 in fines for an overdue library book. If the penalty for overdue books is $0.09 per day, how many days late was the book?
What numbers can to equal 1080
Use “figure of speech” in a sentence
$10,000 is invested for 5 years with an APR of 2.75% and monthly compounding.
how to make snow ice cream with sweetened condensed milk
A scale drawing of a kitchen is shown below. The scale is 1 : 20. Show your work to determine the area of the room in square feet. SHOW YOUR WORK AND I WILL MAR
what is the eastern most of the great lakes?