Thursday, January 26, 2012

Confirm Box in JavaScript

JavaScript Code:
<script type="text/javascript">
function showBox()
{
var r=confirm("Press to button");
if (r==true)
  {
  alert("You pressed OK!");
  }
else
  {
  alert("You pressed Cancel!");
  }
}
</script>

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

No comments: