Cordial
Cordial

Reputation: 539

jQuery - Show one DIV before certain date, another after

I need to be able to show one div before the new year, and another after the new year - it's a set of certain form elements so I think this is the best way to do it.

Can someone point me in the right direction of syntax?

Any advice appreciated!

Upvotes: 0

Views: 1569

Answers (1)

Gideon
Gideon

Reputation: 18491

   if (new Date() < new Date(2011,1,1))
       $('#before').show();
   else
       $('#after').show();

If both are hidden in the beginning.

Upvotes: 8

Related Questions