Countdown using JavaScript
It's a clock countdown demo using JavaScript.
html |
css |
js1 |
js2 |
when the window onload, the text box and star-button should be created,meanwhile the attributes set one by one.Then insert all we created into the inputArea div in the html.
When click the start button, we can triger an event named startCountdown.
Getting the value of input and translating to the time to seconds.
Launching the function tick every second.
Taking the calculation to get minutes and seconds and display in the time section.
When the remaining time goes to zero, we should reset the time section to original 00:00.