Help in Javascript!!! Again

Lord

All Mighty
Joined
Feb 11, 2011
Messages
15,476
Reaction score
11
Points
31
<html>
<head>
<h1> Welcome </h1>
<script type="text/javascript">
function showPrompt()
{
var name=prompt("Put your Name","");
if(name!="")
{
document.write("Hello "+name+"!, how are you today?");
}
}
</script>
<input type="button"value="Show Pronpt Panel" onclick="ShowPrompt()"/>
</head>
<body>
<script type="text/javascript">

var d=new Date();
var time=d.getHours();
document.write("<p>"+d+"</p>");
if(time<12)
{
document.write("<b>Good Morning!</b>");
}
else if(time>=12&&time<20)
{
document.write("<b>Good Afternoon!</b>");
}
else
{
document.write("<b>Good Night!</b>");
}
</script>
</body>
</html>
What i want is that when i put a name in the prompt window the rest (including the date) doesn't disappear.
 
Come on guys, i really need some help
 

Users who are viewing this thread

Back
Top
monitoring_string = "afb8e5d7348ab9e99f73cba908f10802"