Skip to content

pavithrand24/stopwatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

stopwatch-js

Simple Stopwatch/Timer/Countdown using HTML+JS

DEMO

Setting up

  1. Fork and clone the repository
  2. open Stopwatch.html in any browser

Contribution

  1. Follow the instruction in Setting up
  2. Create issues and wait for it to be reviewed

HTML

<div class="wrapper">
   <h2>Stopwatch</h2>
        <p><span id="seconds">00</span>
        <span id="b">:</span>
        <span id="tens">00</span></p>
        <button id="button-start">Start</button>
        <button id="button-stop">Stop</button>
        <button id="button-reset">Reset</button>
 </div> 

JAVASCRIPT

START

buttonStart.onclick = function() {
      
       clearInterval(Interval);
       Interval = setInterval(startTimer, 10);
    }

STOP

buttonStop.onclick = function() {
         clearInterval(Interval);
    }

RESET

buttonReset.onclick = function() {
       clearInterval(Interval);
      tens = "00";
        seconds = "00";
      appendTens.innerHTML = tens;
        appendSeconds.innerHTML = seconds;
    }

About

Simple Stopwatch/Timer/Countdown using HTML+JS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published