// get the current date and time
var now = new Date()
// Check the time
if ( now.getHours() < 12 )
// It's before noon
// print "Good Morning World!" in the window
document.write("Good Morning World!")
// It's after noon
// just print "Hello World!" in the window
TRY OUT YOUR PROGRAM
This site needs an editor - click to learn more!
You Should Also Read:
Editor's Picks Articles
Top Ten Articles
Content copyright © 2019 by Julie L Baumler. All rights reserved.
This content was written by Julie L Baumler. If you wish to use this content in any manner, you need written permission. Contact BellaOnline Administration for details.