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.

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.

commented: Your response was good. +0

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.