The element
in the script is the id of the tag you pass to the function.
So countdown('div1')
will show a timer in a tag with id="div1"
However your particular timer does not allow multiple instances and uses a global var called interval.
Generate the JSON on the server and the rest takes care of itself
HERE is an OO version that is more precise since it is only calculating the end time instead of relying on interval which will block if the browser is busy: http://jsbin.com/ujuzo5/edit
And here is my original solution with the help of the good folks at SO here: Broken closure - please help me fix it
shoes:
trousers: