Hi all. I've just tried doing a simple script. Here's the script:
______________________________
<script language="JavaScript">
var curdate=new Date()
day=curdate.getDate()
days_left=25-day
if(day<=25)
{document.write("<span>Jack wishes you an early Christmas!<br><br> "+days_left+" days till Christmas...</span><br><br>"); }
if(day==25)
{document.write("<span>Jack wishes you and your family a Merry Christmas!!</span><br><br>"); }
</script>
______________________________
I hope to have a code where on days before the 25th, it would display text saying:
"Jack wishes you an early Christmas!
X days till Christmas...
and on the 25th itself, the page will display:
Jack wishes you and your family a Merry Christmas!!
However, this script shows me all of messages on the 25th. How can I change it in a way that it shows only one?
______________________________
<script language="JavaScript">
var curdate=new Date()
day=curdate.getDate()
days_left=25-day
if(day<=25)
{document.write("<span>Jack wishes you an early Christmas!<br><br> "+days_left+" days till Christmas...</span><br><br>"); }
if(day==25)
{document.write("<span>Jack wishes you and your family a Merry Christmas!!</span><br><br>"); }
</script>
______________________________
I hope to have a code where on days before the 25th, it would display text saying:
"Jack wishes you an early Christmas!
X days till Christmas...
and on the 25th itself, the page will display:
Jack wishes you and your family a Merry Christmas!!
However, this script shows me all of messages on the 25th. How can I change it in a way that it shows only one?