Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Project : CountDown Timer

Approach:

1. In Html file I used two buttons first is used for play and pause and
second for Reset.
2. First button executed the togglePlayPause function in which it check the
variable pause is true or not if true it run the StartTimer otherwise it
pause the countdown.
3. In STARTTIMER function it takes the input value and convert it into
integer and SETINTERVAL function runs every 1 second and reduces
the scdleft variable value every second one by one.
4. On clicking the Pause button the Pause Timer function runs. In
PauseTimer function CLEARINTERVAL used for stop the Interval.
5. On click the RESET button it firstly stop the interval by
CLEARINTERVAL and and make the display to “00:00:00”.
6. When something changes in Input value the HandleInputChange
function runs which check the previous stored value is equal to input
value . If the both are not same the all display data will become
“00:00:00”.

Github Link:
https://github.com/sattvikdwivedi/CountDown_Timer

URL:
https://sattvikdwivedi.github.io/CountDown_Timer/main.html

You might also like