Ask Question
29 September, 15:03

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 4.

+4
Answers (1)
  1. 29 September, 16:51
    0
    var count = 0;

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

    counterElement. innerHTML = count;

    var interval = setInterval (function () {

    count++;

    counterElement. innerHTML = count;

    if (count = = = 4) {

    clearTimeout (interval);

    }

    }, 100);
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 100 milliseconds. Call ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers