1.
Confirm box: this box is used to verify the user
operation.
Syntax: confirm(message);
·
The confirm box contains two buttons “OK” and “CANCEL”
·
If the user clicks on “OK” it returns true value
·
If the user clicks on “CANCEL” it returns false
value
//confirm.html
<html>
<head>
<script type="text/javascript">
var status=confirm("do you want to exit")
document.write("status:="+status);
</script>
</head>
</html>
output:
if you click on "ok" button
if you click on "cancel" button
No comments:
Post a Comment