Javascript Alert() : Popup Box

 JavaScript has three kind of popup boxes: Alert box, Confirm box, and Prompt box.


Alert Box

An alert box is often used if you want to make sure information comes through to the user.

When an alert box pops up, the user will have to click "OK" to proceed.


alert("Hello Adisma");


--------------------------------------------


<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <button  onclick="showAlert()">Alert</button>
    <script>
       
        // alert("Hello Every One");

        //let num = 15;
        // alert("Number is = " + num)

        // if (num >= 18) {
        //     alert("Eligible for  vote")
        // }
        // else{
        //     alert("Not Eligibile")
        // }

  function showAlert(){
            alert ("Hi Everyone, How Are you")
         }


    </script>
</body>

</html>



Comments

Popular posts from this blog

JavaScript Array Shift() method

JavaScript pop() Method

JavaScript Slice() method