I made a countdown timer and coded this in with HTML and CSS, but I wasn’t able to make it functional using jQuery. How can I functionalize this countdown? Here is the HTML structure I prefer the countdown to be in:
<div id="counter-container">
<div class="counter-box">
<div class="counter"><p class="counter-p">#</p></div>
<p class="counter-box-p">days</p>
</div>
<div class="counter-box">
<div class="counter"><p class="counter-p">#</p></div>
<p class="counter-box-p">hours</p>
</div>
<div class="counter-box">
<div class="counter"><p class="counter-p">#</p></div>
<p class="counter-box-p">minutes</p>
</div>
<div class="counter-box">
<div class="counter"><p class="counter-p">#</p></div>
<p class="counter-box-p">seconds</p>
</div>
As you can see, I have already added paragraph elements for days, hours etc, therefore I do not want to embed any extra text through jQuery.
P.S. Could anyone please tell me how to set a new countdown date?
demo
EDIT-1:
counter gets time as seconds.
EDIT-2:
if you want it to work
Datebased, you should change function like this,http://jsfiddle.net/NfLAB/1/