@@ -3,9 +3,9 @@ let seconds = 0;
3
3
let minutes = 0 ;
4
4
let timer ;
5
5
6
- const startButton = document . getElementById ( " start" ) ;
7
- const stopButton = document . getElementById ( " stop" ) ;
8
- const resetButton = document . getElementById ( " reset" ) ;
6
+ const startButton = document . getElementById ( ' start' ) ;
7
+ const stopButton = document . getElementById ( ' stop' ) ;
8
+ const resetButton = document . getElementById ( ' reset' ) ;
9
9
10
10
const updateTime = ( ) => {
11
11
milliseconds += 1 ;
@@ -17,12 +17,9 @@ const updateTime = () => {
17
17
seconds = 0 ;
18
18
minutes += 1 ;
19
19
}
20
- document . getElementById ( "milliseconds" ) . innerText =
21
- milliseconds < 10 ? `0${ milliseconds } ` : milliseconds ;
22
- document . getElementById ( "seconds" ) . innerText =
23
- seconds < 10 ? `0${ seconds } ` : seconds ;
24
- document . getElementById ( "minutes" ) . innerText =
25
- minutes < 10 ? `0${ minutes } ` : minutes ;
20
+ document . getElementById ( 'milliseconds' ) . innerText = milliseconds < 10 ? `0${ milliseconds } ` : milliseconds ;
21
+ document . getElementById ( 'seconds' ) . innerText = seconds < 10 ? `0${ seconds } ` : seconds ;
22
+ document . getElementById ( 'minutes' ) . innerText = minutes < 10 ? `0${ minutes } ` : minutes ;
26
23
} ;
27
24
28
25
const startTimer = ( ) => {
@@ -39,11 +36,11 @@ const resetTimer = () => {
39
36
milliseconds = 0 ;
40
37
seconds = 0 ;
41
38
minutes = 0 ;
42
- document . getElementById ( " milliseconds" ) . innerText = "00" ;
43
- document . getElementById ( " seconds" ) . innerText = "00" ;
44
- document . getElementById ( " minutes" ) . innerText = "00" ;
39
+ document . getElementById ( ' milliseconds' ) . innerText = '00' ;
40
+ document . getElementById ( ' seconds' ) . innerText = '00' ;
41
+ document . getElementById ( ' minutes' ) . innerText = '00' ;
45
42
} ;
46
43
47
- startButton . addEventListener ( " click" , startTimer ) ;
48
- stopButton . addEventListener ( " click" , stopTimer ) ;
49
- resetButton . addEventListener ( " click" , resetTimer ) ;
44
+ startButton . addEventListener ( ' click' , startTimer ) ;
45
+ stopButton . addEventListener ( ' click' , stopTimer ) ;
46
+ resetButton . addEventListener ( ' click' , resetTimer ) ;
0 commit comments