Advertising
Paste Description for A greeting message
Insert this JavaScript into your Website to see the results. It gives a message to the viewer.
- A greeting message
- Tuesday, October 2nd, 2007 at 5:28:10pm MDT
- /* This was made by Joshua, */
- /* October 02, 2007 6:27PM */
- /* Removal of these comments is not prohibited */
- //Put this part in the <head> </head> tags
- <style type="text/css">
- #msg1 {
- font-style:italics;
- font-size:.9em;
- color:yellow;
- width:400px;
- height:20px;
- background-color:darkblue;
- border-left:1px solid red;
- border-bottom:1px solid red;
- }
- </style>
- /*This goes inside the body of your HTML document*/
- <div id="msg1">
- <script type="text/javascript">
- var question="What is your name?";
- var response = prompt(question,"Anonymous");
- var d = new Date();
- var time = d.getHours();
- if (time > 6 && time < 11);
- {
- document.getElementById("msg1").innerHTML = "Good Morning, " + response;
- }
- else if (time > 12 && time < 16);
- {
- document.getElementById("msg1").innerHTML = "Good Afternoon, " + response;
- }
- else if (time > 17 && time < 20);
- {
- document.getElementById("msg1").innerHTML = "Good Evening, " + response;
- }
- else if (time > 21 && time < 5);
- {
- document.getElementById("msg1").innerHTML = "I should be in bed...You should probably get some sleep too, " + response;
- }
- </script>
- </div>
Paste Details
Tags: javascript css html message
advertising
Update the Post
Either update this post and resubmit it with changes, or make a new post.
You may also comment on this post.
Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.