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
To save the changes to the layout of a table, click the Save button on the _____.
kari74 [83]
Quick access toolbar :)))))))))
7 0
3 years ago
Given main() and a base Book class, define a derived class called Encyclopedia. Within the derived Encyclopedia class, define a
alexandr1967 [171]

Answer:

..

Explanation:

i dont really know. I am just answering for the sake of points lol

8 0
2 years ago
A DFA is equivalent in power to an NFA. True False
sattari [20]

Answer: True

Explanation:

  Yes, the given statement is true that a DFA is equivalent to NFA in terms of power. For any type of NFA we can easily build an equal DFA so, the NFA are not much powerful as compared to DFA. Both NFA and DFA are characterized by a similar type of class.

DFA is a special case of NFA and They both defined in the same class of language. Each condition in the DFA get summarized by all the condition that the NFA has itself.

4 0
3 years ago
Ask the user for five-coordinate pairs. Store each pair as a tuple, and store all the pairs in a list. Print the slope between a
Margaret [11]

Answer:

y=(1/2) x+3

Explanation:

8 0
2 years ago
In python:
egoroff_w [7]

Python can be used to implement central of tendencies such as mean, median and mode using the statistic module

The program in Python, where comments are used to explain each line is as follows:

#This imports the statistics module

import statistics

#This defines the function that calculates the mode

def calcMode(myList):

   #This prints the mode

   print(statistics.multimode(myList))

#This defines the function that calculates the median

def calcMedian(myList):

   #This prints the median

   print(statistics.median(myList))

#The main method begins here

#This initializes the list

myList = []

#The following iteration gets input for the list

for i in range(10):

   myList.append(int(input()))

#This calls the calcMode method

calcMode(myList)

#This calls the calcMedian method

calcMedian(myList)

Read more about similar programs at:

brainly.com/question/25026386

8 0
3 years ago
Other questions:
  • _____________ is a service that provides access to hardware resources available over the Internet.
    11·1 answer
  • Using the _____ model brings sellers and buyers together on the web and collects commissions on transactions between these parti
    5·1 answer
  • What are the advantages to using a linked implementation as opposed to an array implementation?
    8·1 answer
  • Write modified code that will generate a random number between 0 and 255 when a button is pressed and will write the number to t
    14·1 answer
  • Silas develops this algorithm to compute the calories burned for an activity for a given number of minutes and body weight: If t
    6·1 answer
  • Do anyone else receive random points from Brainly… because I swear I had like 2K+ something and I check and Im at ACE… and with
    10·1 answer
  • Language modeling incorporates rules of __. Select all that apply.
    7·1 answer
  • Which type of network consists of multiple Windows computers that share information, but no computer on the network serves as an
    15·1 answer
  • How can you prevent someone with access to a mobile phone from circumventing access controls for the entire device
    5·1 answer
  • Dynamics
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!