Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.65 KB | None | 0 0
  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. if(s<0)
  15. {
  16. document.getElementById('timer').innerHTML=s +" seconds";
  17. }
  18. if(m>0)
  19. {
  20. document.getElementById('timer').innerHTML=m +" minutes" +s +" seconds";
  21. }
  22. else if(h>0)
  23. {
  24. document.getElementById('timer').innerHTML=h +" hours" +m +" minutes" +s +" seconds";
  25. }
  26. }
  27. function seconds(){
  28. s++;
  29. }
  30. function minutes(){
  31. m++;
  32. }
  33. function hours(){
  34. h++;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement