Countdown minutes in Javascript

A simple way to include a countdown on any page.

Demo

Usage

This script generates a countdown (minutes + seconds). The countdown can persist as the user leaves the page and returns later. Number of minutes can of course be changed.

Note: persistence is "on" for the example above. This means that if you leave the page, the countdown will resume upon return. Also, once the countdown reaches 0:00 it does not restart until you close and re-open the browser (or, delete cokkies).)

Instructions

Use this file with a "script" tag in the page template "<head>" section:

<script type="text/javascript" src="path/to/countdown.js"></script>

NOTE: Target page must have a container element with id "countdown_timer"

That's all.

Example
- countdown 2 mins: Include code below in target page:

<script>cd_countdown(2,true);</script>

Source code

Click "download" link below and the code will be visible

Download

countdown.js (2.1kB) (right-click the link, and choose "Save link/target as...")

Version and License

Version

Current version: 1

License

What? Free!