0

How can I make a welcome page

I want a code snippet of making the text change from hour (x) to hour (y) for example : I want my page to say "Good Morning" from hour (4) to hour (12)

1/11/2020 8:32:37 PM

Eyad Farah

2 Answers

New Answer

+3

let hour = new Date().getHours(); if (hour >= 4 && hour <= 12) console.log("Good Morning"); The rest is up to you.

+1

Use the JavaScript getHours() method. See... https://www.w3schools.com/jsref/jsref_gethours.asp there's even an example.