Ask coding questions

← Back to all posts
ReferenceError: prompt is not defined
shwaldemar (2)

Hi there, Newbie seeking basic advice. When I try to use prompt or alert e.g. prompt("Enter passcode"); I get the following error.. ReferenceError: prompt is not defined. Any idea what I'm doing wrong ;0)

Comments
hotnewtop
TheDrone7 (1901)

I'm going to take a guess and say that you tried using a node.js repl for making a website. If that is the case, remake your repl as a HTML, CSS, JavaScript repl and you can get rid of the error.

Upvote if you agree (lol)

ArchieMaclean (928)

@TheDrone7 I thought that was probably what happened too, I was just wanting to check :)

TheDrone7 (1901)

@ArchieMaclean this is the second time I've seen this happen so I was pretty sure.

ArchieMaclean (928)

Do you have a link to the repl?

shwaldemar (2)

I've fixed it now thanks @ArchieMaclean