Thursday, January 26, 2012

Prompt Box

JavaScript Code:
<script type="text/javascript">
function showBox()
{
var name=prompt("Please enter your name", "Anil");
if (name!=null && name!="")
  {
    document.write("Hello " + name + "! How are you?");
  }
}
</script>

HTML Code:
<input type="btn_Sow" onclick="showBox()" value="Show!" />

No comments: