// Update the count down every 1 second var x = setInterval(function() { // Get todays date and time var now = new Date().getTime(); // Find the distance between now an the count down date // Time calculations for days, hours, minutes and seconds // Display the result in the element with id="time" // If the count down is finished, write some text }, 1000);