Prompt Box tutorial in JavaScript

 <!DOCTYPE html>

<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Prompt Box JavaScript</title>
    <script>
        var a = prompt("What is your name ?");
        alert(a);
        document.write(a + "<br><br>");

        var per = prompt("Enter your percentage : ");

        if (per >= 80 && per <= 100) {
            document.write("You are in Merit.");
        }
        else if (per >= 60 && per <= 80) {
            document.write("You are in Ist Division.");
        }
        else if (per >= 45 && per <= 60) {
            document.write("You are in IInd Division.");
        }
        else if (per >= 33 && per <= 45) {
            document.write("You are Fail.");
        }
        else {
            document.write("Please Enter valid percentage.");
        }
    </script>
</head>

<body>
</body>

</html>




Comments

Popular posts from this blog

Symbols tutorial in Advance JavaScript

Async and Await Method tutorial in Advance JavaScript

String Methods in JavaScript