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>

Comments

Popular posts from this blog

Aggregate Function In Django ✅

Student Registration System Php-MongoDB Project