Creating a JavaScript That Displays Daily Specials
Command Line Retrieve Current Date

You will now need to enter a JavaScript in the body of your home page that will retrieve the current date information and save it as a variable named WeekDay. First, place your <SCRIPT> tags where you want the daily special to appear. Add an HTML comment tag and a JavaScript comment line to hide the script from older browsers.

Within the body <SCRIPT> tags, just above the stop hiding line, enter the following command line that uses the getDay() method to extract the day of the week from the Today Variable and save it as a variable named WeekDay.

var Today = new Date();
var ThisDay= Today.getDay();
var WeekDay = Today.getDay();

You will now use the document.write() method to display the value of DishDesc(WeekDay) on your Web page. Copy the following code below the command lines you inserted above.

var spec = DishName (WeekDay);
document.write(spec + "<BR>");
var description = DishDesc (WeekDay);