Hello, I have a question with the program javascript and in the program I need to create a timer in which it will give me good morning from midnight till noon, good afternoon, noon till 5pm, and good evening from 5pm till midnight. The is I have so far in the webstorm text editor: // hello.js// This is a client-side JavaScript program that tells the time.// It is meant to be embeded in a web page named "hello.html".var today = new Date()var curHr = today.getHours()if (curHr < 12) {console.log('good morning')} else if (curHr < 18) {console.log('good afternoon')} else {console.log('good evening')}function displayHello() {document.getElementById("displayArea").innerHTML= curHr + " Current time is: " + new Date();}Sorry I couldn't upload the attachment for some reason. I appreciate it though.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter15: Using Javafx And Scene Builder
Section: Chapter Questions
Problem 5RQ
icon
Related questions
Question
100%

Hello, I have a question with the program javascript and in the program I need to create a timer in which it will give me good morning from midnight till noon, good afternoon, noon till 5pm, and good evening from 5pm till midnight. The is I have so far in the webstorm text editor: // hello.js
// This is a client-side JavaScript program that tells the time.
// It is meant to be embeded in a web page named "hello.html".
var today = new Date()
var curHr = today.getHours()

if (curHr < 12) {
console.log('good morning')
} else if (curHr < 18) {
console.log('good afternoon')
} else {
console.log('good evening')
}
function displayHello() {
document.getElementById("displayArea").innerHTML= curHr + " Current time is: " + new Date();
}
Sorry I couldn't upload the attachment for some reason. I appreciate it though.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Multimedia tools and applications
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT