Assignment 39: A Possible Answer


     The script's effect was achieved with this code in place of the original code that set AM and PM:

var ampm = RightNow.getHours() +1
if (ampm > 18)
{nampm = "PM Good Evening"}
if (ampm > 12)
{nampm = "AM Good Afternoon"}
if (ampm < 12 )
{nampm = "AM Good Morning"}

     Setting the three levels backwards, starting with "Good Evening," allows you to make all three statements a "less than" setup.


Gives you this:


Did You Get It?


Back to the Index Page