Prompt() Not Working...?

javascript

#1

Hello there. I have finished the JavaScript course and now I am making a JavaScript game, however the prompt() is not working. Is there something wrong with my computer or is it my syntax?
Here it is:
var name = prompt("What is your name?", "Type your first name here");
I have also tried deleting the second string in the prompt() to see if that was the problem, but it still doesn't work although it did work in the courses. Please help, this is going to be a present for someone!


#2

Hi Gravewatcher,

How are you running the JavaScript code?


#3

I made a CodeBit with HTML, CSS, and JavaScript.


#4

Would you mind giving me the link to it, then?
Thanks :)


#5

https://www.codecademy.com/GraveWatcher/codebits/sPjLov


#6

You need to either uncomment line 1, or comment out line 19, because the extra closing curly brace (}) is throwing an error :)