views:

466

answers:

2

Hello I want to make a function either using pure Javascript or also benefiting from jquery to count down to an ending time such as:

//consumes a javascript date object
function countDown(endtimme){
...
}

and it should display in html such as

<div id="time_left_box">
    <h1>Time remaining</h1>:

    <p>hours left: ..remaining day will be here## <p>
    <p>minutes left: ##remaining day will be here## <p>
    <p>seconds left: ##remaining day will be here## <p>
</div>

Indeed and it would be even more great if it can refresh itself every second.

I am very naive with javascript and confused about how to approach, any help would be appreciate.

+1  A: 

You could use jQuery Countdown

marcgg
+1  A: 

Take a look at this one: http://keith-wood.name/countdown.html

Jeff Maes
i just said that :)
marcgg
Yeah sorry ;-) I was just too late
Jeff Maes
I think the OP wants to make a function and not use a plugin.
Reigel
@reigel he's talking about using jquery in his question, so... well anyways it's up to the OP to be more precise here, he didn't even aknowledge @jeff's answer nor mine
marcgg