A simple stop clock built with JavaScript that allows users to start, stop, and reset a timer. This project is designed to demonstrate the use of JavaScript's setInterval
, DOM manipulation, and basic event handling.
- Start the clock by clicking the "Start" button.
- Stop the clock by clicking the "Stop" button.
- Reset the clock to 00:00 by clicking the "Reset" button.
- Timer updates every second and shows minutes and seconds.
Follow these steps to run the project locally:
-
Clone or download the repository to your local machine.
-
Navigate to the project directory.
-
Open the
index.html
file in any web browser.
- The timer begins at
00:00
and updates every second when the "Start" button is clicked. - When the "Stop" button is clicked, the timer pauses.
- The "Reset" button stops the timer and resets it back to
00:00
. - The
setInterval
function is used to increment the timer every second, while theclearInterval
function is used to stop it.
When you open the webpage in your browser, you'll see the following:
- The time displayed as
00:00
. - Buttons labeled Start, Stop, and Reset.
Click the Start button to begin the clock. Click Stop to pause it. Click Reset to reset the clock to 00:00
.
index.html
: The HTML structure of the Stop Clock interface.index.js
: The JavaScript that handles the functionality of the stop clock.
This project is licensed under the MIT License - see the LICENSE file for details.
If you have any questions, feel free to reach out!