0

Hi All,

I have a problem in one coding part that was " I want to display one prompt box. When i click on the particular prompt box then it prompts for your name. When you given a name for example Mother, it must display a message like "Greeting mother" on the below prompt box".

Please help me. Urgent required.

2
Contributors
2
Replies
6
Views
7 Years
Discussion Span
Last Post by Rameshkeerthi
1

I understood your point. Try this below code...

<html>
<head>
<script type="text/javascript"> 
function disp_prompt()
{
var fname=prompt("Please enter your name:","Your name")
document.getElementById("msg").innerHTML="Greetings " + fname
}
</script>
</head>
<body>
 
<input type="button" onclick="disp_prompt()" value="Display a prompt box" />
<br /><br />
 
<div id="msg"></div>
 
</body>
</html>

It was working fine to me.

Votes + Comments
Your response was good.
1

Thank you so much Jayavardhan. It was also working superbly to me. Once agian Thanks...

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.