Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var s="0";
  2. var m="0";
  3. var h="0";
  4. function stop(){
  5. clearInterval(hours);
  6. clearInterval(minutes);
  7. clearInterval(seconds);
  8. }
  9. function timer(){
  10. var seconds=seconds.setInterval("seconds()",1000);
  11. var minutes=minutes.setInterval("minutes()",60000);
  12. var hours=hours.setInterval("hours()",3600000);
  13. }
  14. function element(){
  15. if(s<0)
  16. {
  17. document.getElementById('timer').innerHTML=s +" seconds";
  18. }
  19. if(m>0)
  20. {
  21. document.getElementById('timer').innerHTML=m +" minutes" +s +" seconds";
  22. }
  23. else if(h>0)
  24. {
  25. document.getElementById('timer').innerHTML=h +" hours" +m +" minutes" +s +" seconds";
  26. }
  27. function seconds(){
  28. s++;
  29. }
  30. function minutes(){
  31. m++;
  32. }
  33. function hours(){
  34. h++;
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement