How To Check A User Is Capable For Voting In JavaScript ?🔥🔥🔥




<html>
<head>
    <title>Voting Calculator</title>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
</head>
<body>
    <h2 style="text-align: center;">Welcome to Voting calculator!!!</h2>
<button onclick="vote()" 
 style="background-color: aqua;font-size: large;text-align: center;">Click Me
</button>
    <script>
        function vote() {
            var age = prompt("Enter your age");
            if (!isNaN(age)) 
            {
    var voteable = (age >= 18? alert("congo you are eligible to vote!!!":  
alert("sorry try after " + (18 - age+ " years");
            }
            else 
            {
                alert("plz enter no only");
            }
        }
        vote();
    </script>
</body>
</html>

Post a Comment

0 Comments