Ask coding questions

← Back to all posts
alert() method doesn't work
umbur

The following code's alert() method is not working:

After execution it gives the following error:

Answered by ibbi [earned 5 cycles]
View Answer
Voters
BryanChoo
umbur
Comments
hotnewtop
ibbi

Looks like you might be running the alert function in a node.js repl, instead of a https://repl.it/languages/html repl's script.js file.

umbur

@ibbi I was running the code in my newly created Javascript repo; I thought it should work there as well..
Anyway it works on your provided html/css/javascript repo's script.js file, thanks!