Wednesday, November 13, 2013

Counting Down to a date with Javascript

I recently added a couple of countdown timers to the right side of my blog for some major events coming up.  If you're wondering how I did it, I did what any self-respecting coder would do: I checked Google.

Unfortunately I didn't come up with anything that was very easy to use.  So I took what I found and modified it.  Here's is the resulting code:


The comments in the code should make it self explanatory.  The function can be called any number of times for any number of countdown timers on the page.  Just set a different var name and target.