Ask Question
28 August, 05:45

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

+3
Answers (1)
  1. 28 August, 06:13
    0
    var count = 0;

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

    counterElement. innerHTML = count;

    var interval = setInterval (function () {

    count++;

    counterElement. innerHTML = count;

    if (count = = = 3) {

    clearTimeout (interval);

    }

    }, 400);
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Write a setInterval () function that increases the count by 1 and displays the new count in counterElement every 400 milliseconds. Call ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers