Javascript confirm Definition and Usage
The Javascript confirm() method is used to display a dialog box with a specified message and an OK and a Cancel button.
Javascript confirm Syntax
Javascript confirm Example
<html>
<head>
<script type="text/javascript">
function disp_confirm()
{
var name=confirm("Press a button")
if (name==true)
{ document.write("You pressed the OK button!") }
else
{ document.write("You pressed the Cancel button!") }
}
</script>
</head>
<body>
<form>
<input type="button" onclick="disp_confirm()" value="Display a confirm box">
</form>
</body>
</html> |
|