Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var s="0";
- var m="0";
- var h="0";
- function stop(){
- clearInterval(hours);
- clearInterval(minutes);
- clearInterval(seconds);
- }
- function timer(){
- var seconds=seconds.setInterval("seconds()",1000);
- var minutes=minutes.setInterval("minutes()",60000);
- var hours=hours.setInterval("hours()",3600000);
- }
- function element(){
- if(s<0)
- {
- document.getElementById('timer').innerHTML=s +" seconds";
- }
- if(m>0)
- {
- document.getElementById('timer').innerHTML=m +" minutes" +s +" seconds";
- }
- else if(h>0)
- {
- document.getElementById('timer').innerHTML=h +" hours" +m +" minutes" +s +" seconds";
- }
- function seconds(){
- s++;
- }
- function minutes(){
- m++;
- }
- function hours(){
- h++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement