Back to Scripts page
Click in the box below, select all and copy to grab the script
<HTML> <HEAD> <TITLE>What time is it? JavaScript knows...</TITLE> </HEAD> <BODY BGCOLOR=WHITE> <H1> <SCRIPT LANGUAGE=JAVASCRIPT> <!-- Hide script from old browsers // This script copyright 1997, Tom Negrino and Dori Smith. // This script is from "JavaScript for the WWW, Visual QuickStart Guide, 2nd Ed." // For more information, see <http://www.chalcedony.com/javascript/>. // This script may be used and modified, but the copyright notice must remain intact. now = new Date if (now.getHours() < 5) { document.write("What are you doing up so late?") } else if (now.getHours() < 9) { document.write("Good Morning!") } else if (now.getHours() < 17) { document.write("No surfing during working hours!") } else { document.write("Good Evening!") } // End hiding script from old browsers --> </SCRIPT> </H1> </BODY> </HTML>