Javascripts > Javascript Clocks > Time of Day Message Script
Script Title: Time of Day Message Script
Description: This script shows a different message depending on the time of day.
Example: Available
Copy the following code between the <BODY></BODY> tags of your html page.<script language="Javascript"> <!-- /* Credit must stay intact Visit java-scripts.net or http://wsabstract.com for this script */ 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 work hours!") } else { document.write("Good evening!") } //--> </script>
Enter your name and email address to have this script sent right to your Inbox for later viewing. First Name Last Name Email