1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Eva8 [605]
3 years ago
12

Write a setInterval() function that increases the count by 1 and displays the new count in counterElement every 300 milliseconds

. Call clearInterval() to cancel the interval when the count displays 5.
var count = 0;


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


counterElement.innerHTML = count;



/* Your solution goes here*/
Computers and Technology
1 answer:
Alina [70]3 years ago
8 0

Answer:

  1. var count = 0;
  2. var counterElement = document.getElementById("counter");
  3. counterElement.innerHTML = count;
  4. var a = setInterval(
  5.    function(){  
  6.        count++;
  7.        counterElement.innerHTML = count;
  8.        if(count == 5){
  9.            clearInterval(a);
  10.        }
  11.    }
  12.        , 300);

Explanation:

The solution code is given from Line 6 - 15.  

setInterval function is a function that will repeatedly call its inner function for an interval of time. This function will take two input, an inner function and the interval time in milliseconds.  

In this case, we define an inner function that will increment count by one (Line 8) and then display it to html page (Line 9). This inner function will repeatedly be called for 300 milliseconds. When the count reaches 5, use clearInterval to stop the innerFunction from running (Line 11 - 13).  

You might be interested in
What is an assembler?
Flauer [41]

an assembler is a program that converts code written in a high-level language to assembly language that the computer processor can execute.

4 0
3 years ago
What does a virus do to a computer? How can it be fixed?
miv72 [106K]
A virus can do many things from burn up your hard drive to just annoy you with ads. the best thing you can do if you think you have one is take it to a professional
4 0
2 years ago
Can someone explain to me how to do circuit calculations
GenaCL600 [577]

Use the following rules:

- The sum of currents that enter and exit a node (junction) is always zero. So if you have 3 wires that connect, through one flows 2A, the other 3A, then the third must deliver 5A (taking the direction into account!)


- The sum of voltages across different components should always add up. So if you have a battery of 10V with two unknown resistors, and over one of the resistors is 4V, you know the other one has the remaining 6V.


- With resistors, V=I*R must hold.

With these basic rules you should get a long way!

7 0
3 years ago
This is Very very Important to me[BRAINLIEST)✅​
sineoko [7]

Answer:

Rom

mellisa

Explanation:

pls mark me BRAINLIAST

4 0
2 years ago
A feature that displays in the lower right corner of a selected range with which you can analyze your data by using Excel tools
bagirrra123 [75]

Answer:

Quick analysis tool.

Explanation:

Excel is a spreadsheet application package found in the Microsoft office suite. it's environment on the display screen is called a worksheet and a collection of the worksheets is called a workbook. The excel packet is used for data analysis and interpretation and presentation.

When a group of cells in a worksheet is selected, a small tool kit appears that the lower right corner, it is known as a quick analysis tool. It is use for easy and fast analysis and formatting of that selected group.

5 0
3 years ago
Read 2 more answers
Other questions:
  • to prevent long page load time for pages containing images. It is best to use a compress file formatlike jpeg as well as appropr
    6·2 answers
  • Array A is not a heap. Clearly explain why does above tree not a heap? b) Using build heap procedure discussed in the class, con
    15·1 answer
  • BEING TIMED HELP ASAP
    12·2 answers
  • The term integration mean?
    7·2 answers
  • ___________ is related to mass, but also includes the gravitational pull of the Earth.
    14·1 answer
  • Which operating system (OS) is used to run your laptop?
    15·2 answers
  • Running the Disk Cleanup utility is a quick way to ________. Group of answer choices defrag your hard drive remove spyware progr
    10·1 answer
  • Write a Coral program using integers userNum and x as input, and output userNum divided by x four times.
    7·1 answer
  • Hi everyone can anyone tell me how to align the photo the right in code.org
    8·1 answer
  • 84 104 101 32 97 110 115 119 101 114 32 105 115 32 53 48 33 There's a way to make this meaningful; find it!
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!