I haven't done anything wrong


#1


#2

Store the prompt in a variable


#3

Also null probably means you pressed cancel maybe just enter something.


#4

I'm having the same problem. Sorry how do you do that? (I'm completely new to this)


#5

lets say i call my variable

user_answer

I can store the prompt in it like this

user_answer = prompt("The question you wish to ask the user here");

#6

I'm pasting exactly the same code and it's not working :confused:


#7

Irene, technically Rydan's code that he provided should work. As you stated that you are copying and pasting the code have you tried to re-type the punctuation, from my experience with coding sometimes if you copy and paste code into a text editor or IDE, it doesn't like it. Alternatively if you are still struggling with this question please forward me a print screen of your error message and I will be happy to help :grinning:.


#8

That's right some sites don't use plain text but some formatting stuff or funny tokens for `'" aso but afaik this should work. Also it often helps to refresh the page if there is no obvious error.