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:
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started