Click here to Skip to main content
15,896,154 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
var name=prompt:"What is your name?";
var question=prompt :"Here is a question for you ? "+name " , Can you die for your machine which has all your games" ;
var answer=prompt:"Your answer(Yes/No)";

if (answer=='Yes'){
document.write=("you are a crazy narc like me!!"+name +" ,welcome to the den, the weird side!!!");
}
else if(answer=='No'){
document.write=("Eh! liar you are not qualified to be on this site, Adios"+name);
}





What I have tried:

changing variable name and conditions
Posted
Updated 12-Jan-18 10:03am

1 solution

There are some syntax error in the code. Here is a working example.

JavaScript Prompt[^]
 
Share this answer
 
Comments
Member 13515696 11-Nov-17 11:17am    
it still does not execute the condition
Bryian Tan 11-Nov-17 11:36am    
Did it prompt? The condition is Case sensitive. Must enter Yes or No
Sinisa Hajnal 11-Nov-17 15:31pm    
You should add more details to the question. What error? What doesn't work? Also, you should take all spellings into consideration. Or offer Y/N y/n
Karthik_Mahalingam 11-Nov-17 20:16pm    
5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900