Quantcast
Channel: w3mentor » Javascript
Viewing all articles
Browse latest Browse all 100

Get time of day using Javascript

$
0
0
This script segment prints a short greeting based on the time of day. var now = new Date() var hour = now.getHours() var text = " " if (hour < 12) text = " morning" else if (hour < 16) text = " afternoon" else if (hour < 20) text = " evening" else text […]
Continue reading...

Viewing all articles
Browse latest Browse all 100

Trending Articles