With your if statement grouping, you are missing an extra parenthesis for each pairing which breaks that if statement.
Also the comparison of the gen variable needs to use the == comparison operater (just a single = sets a variable, 2 or 3 = signs will compare).
And the male and female comparison strings much be enclosed in some form of a quote.
It also would be proper practice to use semi-colons at the end of each proper line of code:
Code:
<html>
<body>
<script>
var age=prompt("what's your age");
var gen=prompt("what's your gge");
if((age>=21 && gen=="male") || (age>=18 && gen=="female")) {
document.write("eligble");
} else {
document.write("not eligble");
}
</script>
</body>
</html>
"Given billions of tries, could a spilled bottle of ink ever fall into the words of Shakespeare?"
Bookmarks