Possible Duplicate:
How to create a JQuery Clock / Timer
Does anyone knows countdown timer using javascript??
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Using pure javascript, you would use the
setTimeoutmethod in a manner similar to this (treat this code as pseudocode, it is just to show the concept, I do not think it will work as-is):You would start the countdown by writing something in the element with id
countdownBoxand callingcountdown()for the first time.Edit: note that the
setTimeoutmethod will tend to lose seconds if used this way – if you want real precision you will most likely have to synchronize externally every once in a while.