Display Confirmation box using JavaScript

In the Conformation Box, one box will appear and ask for conformation like “OK” and “Cancel” option.

<!DOCTYPE html>
<html>
<head>
</head>
<body>
<p>Display Confirmation Box using JavaScript</p>
<button onclick="showConformationMessage()" id=btnClick>Click here to check your account is created or not </button>
<script type="text/javascript">
function showConformationMessage(){
var name = confirm("Are you want to use the account");
if (name == true){
alert(" Account created sucessfully");
}
else{
alert("sorry,try again Your account is not created");
}
}
</script>
</body>
</html>

Output:-

“Are you want to use the account”. We can click on “Ok” or “Cancel”

One thought on “Display Confirmation box using JavaScript

  • April 24, 2022 at 1:49 pm
    Permalink

    Hello! Someone in my Facebook group shared this website with us,
    so I came to give it a look. I’m enjoying the information. I’m bookmarking and will be tweeting
    this to my followers! Wonderful blog and amazing design and style.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *