Hi,
I'm creating an advent calendar and I need a piece of jQuery/Javascript that will change the class on a div based on the date.
I need all previous days to have one class, the present day one class and future dates one class.
This is my source code:
<div id="container">
<div class="box nov28">...</div>
<div class="box dec1">...</div>
<div class="box dec3">...</div>
<div class="box dec5">...</div>
<div class="box dec7">...</div>
<div class="box dec12">...</div>
<div class="box dec15">...</div>
<div class="box dec17">...</div>
<div class="box dec19">...</div>
<div class="box dec21">...</div>
<div class="box dec22">...</div>
<div class="box dec23">...</div>
</div>
It's not a simple begin 1st December and proceed for 24 days. There are 12 days of 'offers' which will not follow on exactly. This can be seen by the div classes i.e. nov28 dec1 dec3
On the class days I need the class present to be added, on previous days - the class previous and on future dates - the class future.
All help appreciated.
--EDIT --
Original post amended to be more specific.