0

"if" is not defined

prompt ("Are you gay?") var myAnswer = ("input") If ("input".length > 2); { document.write ("Haha you are gay") } If ("input".length < 3); { document.write ("Dont lie to me") }

16th Nov 2016, 3:11 PM
cale P
cale P - avatar
2 Antworten
+ 1
/* * Get user input */ var myAnswer = prompt ("Do you know how to code?"); /* * Check user input */ if ( myAnswer.length > 2 ) { document.write ("Great, continue with it"); } else if (myAnswer.length < 3) { document.write ("You should get started."); }
16th Nov 2016, 3:16 PM
Johannes K
Johannes K - avatar
0
Thanks! Just started trying to teach myself.
16th Nov 2016, 3:17 PM
cale P
cale P - avatar