Question: Write a script that displays the current date and time, and welcomes the user with Good morning!, Good afternoon!, or Good evening!, depending on the

Write a script that displays the current date and time, and welcomes the user with Good morning!, Good afternoon!, or Good evening!, depending on the time of day.

You may find it useful to use the Date object, and to create variables to store elements of the date.

var dateObject= new Date(); var greeting = ; var curTime= ; var minuteValue = dateObject.getMinutes(); var hourValue = dateObject.getHours();

Note: You do not have to open a previous exercise to complete this exercise.

When you open your form for the first time, it should resemble this:

Write a script that displays the current date and time, and welcomes

If you keep refreshing, the time will change.

Welcome to my Web Page Good morning! It is 9:59 AM on Thursday, November 2, 2017

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!