javascript countdown


SUBMITTED BY: Guest

DATE: Jan. 5, 2014, 2:56 a.m.

FORMAT: Text only

SIZE: 331 Bytes

HITS: 1296

  1. var count=30;
  2. var counter=setInterval(timer, 1000); //1000 will run it every 1 second
  3. function timer()
  4. {
  5. count=count-1;
  6. if (count <= 0)
  7. {
  8. clearInterval(counter);
  9. //counter ended, do something here
  10. return;
  11. }
  12. //Do code for showing the number of seconds here
  13. }

comments powered by Disqus