Days of the Week Java Script

I wrote this script to take the reader to a page where he/she can learn about the current day of the week:

<script type=”text/javascript”>
<!–
var d = new Date();
theday = d.getDay();
document.write(“Learn about this day of the week: “);
switch (theday)
{
 case 0:
  document.write(“<a href=\”http://www.indepthinfo.com/weekdays/sunday.shtml\”>Sunday</a>”);
  break;
 case 1:
  document.write(“<a href=\”http://www.indepthinfo.com/weekdays/monday.shtml\”>Monday</a>”);
  break;
 case 2:
  document.write(“<a href=\”http://www.indepthinfo.com/weekdays/tuesday.shtml\”>Tuesday</a>”);
  break;
 case 3:
  document.write(“<a href=\”http://www.indepthinfo.com/weekdays/wednesday.shtml\”>Wednesday</a>”);
  break;
 case 4:
  document.write(“<a href=\”http://www.indepthinfo.com/weekdays/thursday.shtml\”>Thursday</a>”);
  break;
 case 5:
  document.write(“<a href=\”http://www.indepthinfo.com/weekdays/friday.shtml\”>Friday</a>”);
  break;
 case 6:
  document.write(“<a href=\”http://www.indepthinfo.com/weekdays/saturday.shtml\”>Saturday</a>”);
  break;
}
// –>
</script>

One Comment

Leave a Reply

You must be logged in to post a comment.

Using Gravatars in the comments - get your own and be recognized!

XHTML: These are some of the tags you can use: <a href=""> <b> <blockquote> <code> <em> <i> <strike> <strong>