<html>
<head>
<body onload="ask()">
<title>Javascript Confirm</title>
<script type="text/javascript">
function ask()
{
var x;
x = confirm("Press Button!");
if(x==true)
{
alert("you press OK!");
}
else
{
alert("you press CANCEL!");
}
}
</body>
</head>
</html>