Free Puzzle Questions with Answer using Java, C#, JavaScript and PHP

JavaScript - Manage Dialog

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <script language="JavaScript" type="text/javascript">
        function ShowAlertDialog(){
            alert("Simple notification message");
        }

        function ShowConfirmDialog(){
            var result = confirm("Are you 18 and above years old?");
            if(result == true){
                alert("You are old enough to have a beer");
            }
            else{
                alert("Sorry, not old enough");
            }
        }

        function ShowPromptDialog(){
            var fullname = prompt("Please enter your name here:", "Your Name Here");

            alert("Your name is " + fullname);
        }
    </script>
</head>
<body>
    <button onclick="ShowAlertDialog()">Show Alert Dialog</button>
    <button onclick="ShowConfirmDialog()"> Show Confirm Dialog</button>
    <button onclick="ShowPromptDialog()"> Show Prompt Dialog</button>
</body>
</html>