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
Post a Comment
Comment Rules :
1. Do not post Adult/illegal Links.
2. Try to comment in only เคฎเคฐाเค ी / English Language.
3. Do not post other website's links which are useless.
4. Your Comment should be based on the Topic for other queries.
5. Do not use Abusive Language.
6. Respect each other.
Thank You for following the rules. Please Comment....