Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>IfExample javascript</title>
- <script>
- //this script writes good morning greetings if the time is less than 1pm
- var date = new Date();
- var time = date.getHours();
- if(time < 13) {
- document.write("Good Morning!!");
- }
- else {
- document.write("Good Afternoon!!");
- }
- </script>
- </head>
- <body>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement