12. Showing Confirm Box
JavaScript
<!DOCTYPE html>
<html>
<head>
<title>Confirm
Box</title>
</head>
<body>
<script>
if (confirm("Do you want to
continue?")) {
alert("You clicked OK");
} else {
alert("You clicked Cancel");
}
</script>
</body>
</html>
This will display a confirm box with
an "OK" and "Cancel" button.
No comments:
Post a Comment