Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-11-2012, 03:12 AM   PM User | #1
KittenD
New to the CF scene

 
Join Date: Nov 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
KittenD is an unknown quantity at this point
Need help w/ a small adventure game

Hi,
I am wondering if someone can help me with this little problem. I've been struggling with this small section of code below for the last two days. When I run the code i get a syntax error and also another one that says missing operand; found else. What I am trying to do is depending on age, go to "you can play" if your over 18, and "You can't play" if your under 18. I've exhausted all resources and asked around. Everyone tells me that it is fine. But if it is then why is it not running the way it should? Any ideas? Thanks.

Code:
confirm("I am ready to play!")
age = prompt("How old are you?");
if(age > 18); 
{
	console.log("You can play!");
}
 else
{
	console.log("You can't play!");
}
KittenD is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:08 AM.


Advertisement
Log in to turn off these ads.