-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
45 lines (40 loc) · 1.29 KB
/
Copy pathscript.js
File metadata and controls
45 lines (40 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/**
* Initiate 3 variables (seconds, tens, interval)
* Give a starting value of 0 for seconds and tens
* Use the appropriate variable type for each
*/
/**
* Get the DOM elements for the stopwatch and save them in variables
* Use the appropriate variable type for each
*
* Hint: There are 3 buttons and 2 numbers to manipulate
*/
/**
* Create a function, which is waiting for the user to press the 'Start' button.
* When pressed, set the timer run `runStopwatch` function every 10ms.
*/
buttonStart.onclick = () => {}
/**
* Create a function, which is waiting for the user to press the 'Stop' button.
* When pressed, clear the interval.
*/
buttonStop.onclick = () => {}
/**
* Create a function, which is waiting for the user to press the 'Reset' button.
* When pressed, clear the interval, reset the seconds and tens to 0.
*
* Hint: Don't forget to concatenate a leading '0'.
*/
buttonReset.onclick = () => {}
/**
* Build the `runStopwatch` function.
*/
const runStopwatch = () => {
// Increment the tens.
/**
* Display updated tens and seconds.
* Make sure, that the tens and seconds are always two digits long.
*
* Hint: there are 4 cases you need to handle every time the function runs.
*/
}