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
Phantasy [73]
3 years ago
11

See the answerWrite a setInterval() function that increases the count by 1 and displays the new count in counterElement every 30

0 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:
Debora [2.8K]3 years ago
6 0

Answer:

var count = 0;

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

counterElement.innerHTML = count;

var interval = setInterval(function () {

   count++;

   counterElement.innerHTML = count;

   if (count === 5) {

       clearTimeout(interval);

   }

}, 300);

Explanation:

  • Initialize the count and get access to the counter element using the id.
  • Assign the value of count to counterElement document.
  • Use the setInterval function to set the timer and increases the count by 1.
  • Check if the value of count is equal to 5, then call the built-in clearTimeout function by passing it the interval variable.

You might be interested in
90 points can someone please write the code for this (HTML):
frez [133]

Answer:

Explanation:

1.

First name:

Last name:

.

2.

What fraction of a day is 6 hours?

Choose 1 answer

6/24

6

1/3

1/6

Submit

</p><p> // The function evaluates the answer and displays result</p><p> function displayAnswer1() {</p><p> if (document.getElementById('option-11').checked) {</p><p> document.getElementById('block-11').style.border = '3px solid limegreen'</p><p> document.getElementById('result-11').style.color = 'limegreen'</p><p> document.getElementById('result-11').innerHTML = 'Correct!'</p><p> }</p><p> if (document.getElementById('option-12').checked) {</p><p> document.getElementById('block-12').style.border = '3px solid red'</p><p> document.getElementById('result-12').style.color = 'red'</p><p> document.getElementById('result-12').innerHTML = 'Incorrect!'</p><p> showCorrectAnswer1()</p><p> }</p><p> if (document.getElementById('option-13').checked) {</p><p> document.getElementById('block-13').style.border = '3px solid red'</p><p> document.getElementById('result-13').style.color = 'red'</p><p> document.getElementById('result-13').innerHTML = 'Incorrect!'</p><p> showCorrectAnswer1()</p><p> }</p><p> if (document.getElementById('option-14').checked) {</p><p> document.getElementById('block-14').style.border = '3px solid red'</p><p> document.getElementById('result-14').style.color = 'red'</p><p> document.getElementById('result-14').innerHTML = 'Incorrect!'</p><p> showCorrectAnswer1()</p><p> }</p><p> }</p><p> // the functon displays the link to the correct answer</p><p> function showCorrectAnswer1() {</p><p> let showAnswer1 = document.createElement('p')</p><p> showAnswer1.innerHTML = 'Show Corrent Answer'</p><p> showAnswer1.style.position = 'relative'</p><p> showAnswer1.style.top = '-180px'</p><p> showAnswer1.style.fontSize = '1.75rem'</p><p> document.getElementById('showanswer1').appendChild(showAnswer1)</p><p> showAnswer1.addEventListener('click', () => {</p><p> document.getElementById('block-11').style.border = '3px solid limegreen'</p><p> document.getElementById('result-11').style.color = 'limegreen'</p><p> document.getElementById('result-11').innerHTML = 'Correct!'</p><p> document.getElementById('showanswer1').removeChild(showAnswer1)</p><p> })</p><p> }</p><p>

3.<p> rows="5" cols="30"</p><p> placeholder="type text.">

4. <p>I will display &euro;</p>

<p>I will display &part;</p>

<p>I will display &exist;</p>

5. <input type="submit">

6. This code should be the first code

<!-- This is a comment -->

<p>Start Test.</p>

<!-- Remember to add more information here -->

This code should be the last and at the end of the of the html code

<!-- This is a comment -->

<p>End Test.</p>

<!-- Remember to add more information here -->

Notice: Answers may not be accurate and may be accurate. And pls endeavor to edit any part of the html code.

4 0
3 years ago
Suppose a linked list of 20 nodes. The middle node has a data –250. Write the pseudocode to replace the middle node of the linke
dexar [7]

Answer:

The middle node has a data –250. ... Write The Pseudocode To Replace The Middle Node Of The Linked List With ... Assume That The List's Head Pointer Is Called Head_ptr And The Data For The New Node Is Called Entry ... Assume that the list's head pointer is called head_ptr and the data for the new node is called entry ...

Explanation:

4 0
4 years ago
Read 2 more answers
Name two word processor<br><br>​
Irina18 [472]

Answer:

the bat hunter

Explanation:

3 0
4 years ago
25-words or more in your OWN words the meaning of digital literacy.
jolli1 [7]

Answer:

Digital literacy means having the skills you need to live, learn, and work in a society where communication and access to information are increasingly through digital technologies like internet platforms, social media, and mobile devices.

Explanation:

6 0
3 years ago
1. Which of the following is an example of reusing? (select the best answer)
Alina [70]
1. C. you are reusing, because instead of throwing the couch away, you gave it to someone who will "reuse" it.

2. I'm not sure, but I would say B. recycling. Repurposing things that you have no use for limits how much waste there is and how much must be manufactured. This reduces pollution and limits the burden on the environment.

3. A. is the answer, it is pre-consumer waste because the waste is from the manufacturing process. The waste is not from the consumer(whoever buys the product) so not B. and I doubt it is C. or D.

4. A. is the answer. Burning waste produces greenhouse gasses. B. can't be true, because the gasses from the burning are not the raw material. C. and D. couldn't be the case because water was not present in the disposal.

5. is A. compost center because they only take green waste.

6. A. the orange peal is the only option that is biodegradable.
4 0
4 years ago
Other questions:
  • Which of the following phrases describes top-down processing
    8·1 answer
  • All objects in an object-oriented program are instantiated (created) from a ____.
    12·1 answer
  • You can change the location of the layers panel on the screen by _____ .
    7·1 answer
  • What method of technical drawing uses converging lines?
    7·1 answer
  • D Question 9 What is output by the following?
    5·1 answer
  • How would you reply to an email message you've received that has multiple recipients, all of whom you would like to see your rep
    6·2 answers
  • Malware is any malicious software installed on a computer or network without the owner’s knowledge.
    10·1 answer
  • The ________ marker is the character that marks the end of a file and is automatically written when the file is closed.
    6·1 answer
  • Consider the following method, which is intended to count the number of times the letter "A" appears in the string str.
    13·1 answer
  • Pls answer dis question when i'm not connected and i open bluestacks 5 it will be working but if i am connected it wil not work
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!