JavaScript Confirm Box

JavaScript Confirm Box

Confirm box is used to get confirmation from the user.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<body>
    <script id="javascript">
        var input = confirm("Do you want to proceed?");
        if (input == true)
        {
            alert("You pressed OK!");
        }
        else
        {
            alert("You pressed Cancel!");
        }
    </script>
</body>
</html>

image.png

image.png