Prompt() Not Working...?



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!


Hi Gravewatcher,

How are you running the JavaScript code?


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


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



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