SHARE
TWEET

Untitled

a guest Jun 18th, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html lang = "en">
  3.     <head>
  4.         <title>Stopwatch</title>
  5.     </head>
  6.     <body>
  7.         <div>Seconds: <span id="time"></span></div>
  8.         <input type="button" id="startTimer" value="Start Timer" onclick="start();"><br/>
  9.         <input type="button" id="stopTimer" value="Stop Timer"  onclick="stop();"><br/>
  10.         <input type="button" id="resetTimer" value="Reset Timer"  onclick="reset();"><br/>
  11.         <script src= "timer.js"></script>
  12.     </body>
  13. </html>
  14.  
  15. var myTimer = 0;
  16. var myTimer = setInterval(start, 1000);
  17. function start() {
  18.     document.getElementById("time").innerHTML = ++myTimer;
  19. }
  20. function stop() {
  21.     document.getElementById("time").innerHTML = clearInterval(myTimer);
  22. }
  23. function reset() {
  24.  
  25. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top