on-internet
← Community

Uncaught Error: prompt() is not supported [closed]

Stack Overflow ·

I tried to follow a JavaScript tutorial. I use Visual Studio Code with "Live Server" extension by Ritwick Dey and the integrated browser. Other user input/output like confirm and alert are working as intended, but when I add prompt: const name = prompt("What is your name?: "); I get the following error in console window: index.js:1 Uncaught Error: prompt() is not supported. I run my code from a index.js file, which I link to my index.html at the end of the body tag. But the same happens when scripts in an html document.

Comments

Sign in or sign up to comment and upvote.

No comments yet.