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") }
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.");
}
0
Thanks! Just started trying to teach myself.