Categories:

Home / Free JavaScripts / Clocks, Calenders, And Timers / Here

Cut & Paste Count down until any date (Down-to-the second)

Credit: JavaScript Kit

Description: A different version of the countdown script that counts down until any date, down to the second.

Example:

Directions: Simply insert the below into the <body> section of your page:

There are two areas of the script you'll need to configure. The first is obviously the date you wish the script to count down to. Simply pass in a date, in the form of year, month, and day, into function countdown(), located at the last line of the script:

countdown(2003,12,25)

The second concerns the text to be displayed during the duration of the countdown. This is affected by the lines:

var before="Christmas!"
var current="Today is Christmas. Merry Christmas!"

The first variable (var before) specifies the key word that will be used to display the sentence ""Only so and so days until ____." The second variable specifies the text to be displayed when the counter has expired (the specified countdown-to date).


JavaScript Tools:
Site Info


CopyRight (c) 2018 JavaScript Kit. NO PART may be reproduced without author's permission. Contact Info