How can I make a welcome page | SoloLearn: Learn to code for FREE!


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


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


Use the JavaScript getHours() method. See... there's even an example.