# Prediction site in JavaScript

Now we will make a website that will issue predictions. Let there be a button on this site, by clicking on which a timer will be launched, which will display a random number from `1` to some maximum value every `0.1` seconds into some div.

Let there be another button under the div, by clicking on which the user of our site can stop the timer and fix a certain number in the div. This number will be the prediction number. After that, show the user a prediction with this number, and remove all unnecessary buttons from the screen so that the user cannot get another prediction. That is, one visit to the site - one prediction.

Here is an example of what should be:

Here is the layout that you can use when solving the problem:

`<div id="parent"> <div id="timer">?</div> <div id="text"></div> <button id="start" class="active">know your fate</button> <button id="stop">get a prediction</button> </div>` `#parent { text-align: center; } #parent > * { margin-bottom: 10px; } #timer { font-size: 18px; } #text { font-size: 17px; font-style: italic; } button { padding: 5px 10px; font-size: 15px; cursor: pointer; } button:not(.active) { display: none; }`

Consider how it is more convenient to store predictions.

Implement the described site.

Make it so that there are two kinds of predictions: good and bad. Make the bad ones red and the good ones green.

←→
↑
en ru